<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - coverage_clean.info - 13/bits/chrono.h</title>
  <link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>

<body>

          <table width="100%" border=0 cellspacing=0 cellpadding=0>
            <tr><td class="title">LCOV - code coverage report</td></tr>
            <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>

            <tr>
              <td width="100%">
                <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="10%" class="headerValue"><a href="../../index.html">top level</a> - <a href="index.html">13/bits</a> - chrono.h<span style="font-size: 80%;"> (source / <a href="chrono.h.func-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="5%"></td>
            <td width="5%" class="headerCovTableHead">Coverage</td>
            <td width="5%" class="headerCovTableHead" title="Covered + Uncovered code">Total</td>
            <td width="5%" class="headerCovTableHead" title="Exercised code only">Hit</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">coverage_clean.info</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
            <td class="headerCovTableEntry">13</td>
            <td class="headerCovTableEntry">13</td>
          </tr>
          <tr>
            <td class="headerItem">Test Date:</td>
            <td class="headerValue">2025-11-25 04:45:29</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
            <td class="headerCovTableEntry">7</td>
            <td class="headerCovTableEntry">7</td>
          </tr>
                  <tr><td><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
                </table>
              </td>
            </tr>

            <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
          </table>

          <table cellpadding=0 cellspacing=0 border=0>
            <tr>
              <td><br></td>
            </tr>
            <tr>
              <td>
<pre class="sourceHeading">            Line data    Source code</pre>
<pre class="source">
<span id="L1"><span class="lineNum">       1</span>              : // chrono::duration and chrono::time_point -*- C++ -*-</span>
<span id="L2"><span class="lineNum">       2</span>              : </span>
<span id="L3"><span class="lineNum">       3</span>              : // Copyright (C) 2008-2023 Free Software Foundation, Inc.</span>
<span id="L4"><span class="lineNum">       4</span>              : //</span>
<span id="L5"><span class="lineNum">       5</span>              : // This file is part of the GNU ISO C++ Library.  This library is free</span>
<span id="L6"><span class="lineNum">       6</span>              : // software; you can redistribute it and/or modify it under the</span>
<span id="L7"><span class="lineNum">       7</span>              : // terms of the GNU General Public License as published by the</span>
<span id="L8"><span class="lineNum">       8</span>              : // Free Software Foundation; either version 3, or (at your option)</span>
<span id="L9"><span class="lineNum">       9</span>              : // any later version.</span>
<span id="L10"><span class="lineNum">      10</span>              : </span>
<span id="L11"><span class="lineNum">      11</span>              : // This library is distributed in the hope that it will be useful,</span>
<span id="L12"><span class="lineNum">      12</span>              : // but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span id="L13"><span class="lineNum">      13</span>              : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span id="L14"><span class="lineNum">      14</span>              : // GNU General Public License for more details.</span>
<span id="L15"><span class="lineNum">      15</span>              : </span>
<span id="L16"><span class="lineNum">      16</span>              : // Under Section 7 of GPL version 3, you are granted additional</span>
<span id="L17"><span class="lineNum">      17</span>              : // permissions described in the GCC Runtime Library Exception, version</span>
<span id="L18"><span class="lineNum">      18</span>              : // 3.1, as published by the Free Software Foundation.</span>
<span id="L19"><span class="lineNum">      19</span>              : </span>
<span id="L20"><span class="lineNum">      20</span>              : // You should have received a copy of the GNU General Public License and</span>
<span id="L21"><span class="lineNum">      21</span>              : // a copy of the GCC Runtime Library Exception along with this program;</span>
<span id="L22"><span class="lineNum">      22</span>              : // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see</span>
<span id="L23"><span class="lineNum">      23</span>              : // &lt;http://www.gnu.org/licenses/&gt;.</span>
<span id="L24"><span class="lineNum">      24</span>              : </span>
<span id="L25"><span class="lineNum">      25</span>              : /** @file include/bits/chrono.h</span>
<span id="L26"><span class="lineNum">      26</span>              :  *  This is an internal header file, included by other library headers.</span>
<span id="L27"><span class="lineNum">      27</span>              :  *  Do not attempt to use it directly. @headername{chrono}</span>
<span id="L28"><span class="lineNum">      28</span>              :  */</span>
<span id="L29"><span class="lineNum">      29</span>              : </span>
<span id="L30"><span class="lineNum">      30</span>              : #ifndef _GLIBCXX_CHRONO_H</span>
<span id="L31"><span class="lineNum">      31</span>              : #define _GLIBCXX_CHRONO_H 1</span>
<span id="L32"><span class="lineNum">      32</span>              : </span>
<span id="L33"><span class="lineNum">      33</span>              : #pragma GCC system_header</span>
<span id="L34"><span class="lineNum">      34</span>              : </span>
<span id="L35"><span class="lineNum">      35</span>              : #if __cplusplus &gt;= 201103L</span>
<span id="L36"><span class="lineNum">      36</span>              : </span>
<span id="L37"><span class="lineNum">      37</span>              : #include &lt;ratio&gt;</span>
<span id="L38"><span class="lineNum">      38</span>              : #include &lt;type_traits&gt;</span>
<span id="L39"><span class="lineNum">      39</span>              : #include &lt;limits&gt;</span>
<span id="L40"><span class="lineNum">      40</span>              : #include &lt;ctime&gt;</span>
<span id="L41"><span class="lineNum">      41</span>              : #include &lt;bits/parse_numbers.h&gt; // for literals support.</span>
<span id="L42"><span class="lineNum">      42</span>              : #if __cplusplus &gt;= 202002L</span>
<span id="L43"><span class="lineNum">      43</span>              : # include &lt;concepts&gt;</span>
<span id="L44"><span class="lineNum">      44</span>              : # include &lt;compare&gt;</span>
<span id="L45"><span class="lineNum">      45</span>              : #endif</span>
<span id="L46"><span class="lineNum">      46</span>              : </span>
<span id="L47"><span class="lineNum">      47</span>              : namespace std _GLIBCXX_VISIBILITY(default)</span>
<span id="L48"><span class="lineNum">      48</span>              : {</span>
<span id="L49"><span class="lineNum">      49</span>              : _GLIBCXX_BEGIN_NAMESPACE_VERSION</span>
<span id="L50"><span class="lineNum">      50</span>              : </span>
<span id="L51"><span class="lineNum">      51</span>              : #if __cplusplus &gt;= 201703L</span>
<span id="L52"><span class="lineNum">      52</span>              :   namespace filesystem { struct __file_clock; };</span>
<span id="L53"><span class="lineNum">      53</span>              : #endif</span>
<span id="L54"><span class="lineNum">      54</span>              : </span>
<span id="L55"><span class="lineNum">      55</span>              :   namespace chrono</span>
<span id="L56"><span class="lineNum">      56</span>              :   {</span>
<span id="L57"><span class="lineNum">      57</span>              :     /// @addtogroup chrono</span>
<span id="L58"><span class="lineNum">      58</span>              :     /// @{</span>
<span id="L59"><span class="lineNum">      59</span>              : </span>
<span id="L60"><span class="lineNum">      60</span>              :     /// `chrono::duration` represents a distance between two points in time</span>
<span id="L61"><span class="lineNum">      61</span>              :     template&lt;typename _Rep, typename _Period = ratio&lt;1&gt;&gt;</span>
<span id="L62"><span class="lineNum">      62</span>              :       class duration;</span>
<span id="L63"><span class="lineNum">      63</span>              : </span>
<span id="L64"><span class="lineNum">      64</span>              :     /// `chrono::time_point` represents a point in time as measured by a clock</span>
<span id="L65"><span class="lineNum">      65</span>              :     template&lt;typename _Clock, typename _Dur = typename _Clock::duration&gt;</span>
<span id="L66"><span class="lineNum">      66</span>              :       class time_point;</span>
<span id="L67"><span class="lineNum">      67</span>              :     /// @}</span>
<span id="L68"><span class="lineNum">      68</span>              :   }</span>
<span id="L69"><span class="lineNum">      69</span>              : </span>
<span id="L70"><span class="lineNum">      70</span>              :   /// @addtogroup chrono</span>
<span id="L71"><span class="lineNum">      71</span>              :   /// @{</span>
<span id="L72"><span class="lineNum">      72</span>              : </span>
<span id="L73"><span class="lineNum">      73</span>              :   // 20.11.4.3 specialization of common_type (for duration, sfinae-friendly)</span>
<span id="L74"><span class="lineNum">      74</span>              : </span>
<span id="L75"><span class="lineNum">      75</span>              :   /// @cond undocumented</span>
<span id="L76"><span class="lineNum">      76</span>              : </span>
<span id="L77"><span class="lineNum">      77</span>              :   template&lt;typename _CT, typename _Period1, typename _Period2, typename = void&gt;</span>
<span id="L78"><span class="lineNum">      78</span>              :     struct __duration_common_type</span>
<span id="L79"><span class="lineNum">      79</span>              :     { };</span>
<span id="L80"><span class="lineNum">      80</span>              : </span>
<span id="L81"><span class="lineNum">      81</span>              :   template&lt;typename _CT, typename _Period1, typename _Period2&gt;</span>
<span id="L82"><span class="lineNum">      82</span>              :     struct __duration_common_type&lt;_CT, _Period1, _Period2,</span>
<span id="L83"><span class="lineNum">      83</span>              :                                   __void_t&lt;typename _CT::type&gt;&gt;</span>
<span id="L84"><span class="lineNum">      84</span>              :     {</span>
<span id="L85"><span class="lineNum">      85</span>              :     private:</span>
<span id="L86"><span class="lineNum">      86</span>              :       using __gcd_num = __static_gcd&lt;_Period1::num, _Period2::num&gt;;</span>
<span id="L87"><span class="lineNum">      87</span>              :       using __gcd_den = __static_gcd&lt;_Period1::den, _Period2::den&gt;;</span>
<span id="L88"><span class="lineNum">      88</span>              :       using __cr = typename _CT::type;</span>
<span id="L89"><span class="lineNum">      89</span>              :       using __r = ratio&lt;__gcd_num::value,</span>
<span id="L90"><span class="lineNum">      90</span>              :                         (_Period1::den / __gcd_den::value) * _Period2::den&gt;;</span>
<span id="L91"><span class="lineNum">      91</span>              : </span>
<span id="L92"><span class="lineNum">      92</span>              :     public:</span>
<span id="L93"><span class="lineNum">      93</span>              :       using type = chrono::duration&lt;__cr, typename __r::type&gt;;</span>
<span id="L94"><span class="lineNum">      94</span>              :     };</span>
<span id="L95"><span class="lineNum">      95</span>              : </span>
<span id="L96"><span class="lineNum">      96</span>              :   /// @endcond</span>
<span id="L97"><span class="lineNum">      97</span>              : </span>
<span id="L98"><span class="lineNum">      98</span>              :   /// @{</span>
<span id="L99"><span class="lineNum">      99</span>              :   /// @relates chrono::duration</span>
<span id="L100"><span class="lineNum">     100</span>              : </span>
<span id="L101"><span class="lineNum">     101</span>              :   /// Specialization of common_type for chrono::duration types.</span>
<span id="L102"><span class="lineNum">     102</span>              :   template&lt;typename _Rep1, typename _Period1, typename _Rep2, typename _Period2&gt;</span>
<span id="L103"><span class="lineNum">     103</span>              :     struct common_type&lt;chrono::duration&lt;_Rep1, _Period1&gt;,</span>
<span id="L104"><span class="lineNum">     104</span>              :                        chrono::duration&lt;_Rep2, _Period2&gt;&gt;</span>
<span id="L105"><span class="lineNum">     105</span>              :     : __duration_common_type&lt;common_type&lt;_Rep1, _Rep2&gt;,</span>
<span id="L106"><span class="lineNum">     106</span>              :                              typename _Period1::type,</span>
<span id="L107"><span class="lineNum">     107</span>              :                              typename _Period2::type&gt;</span>
<span id="L108"><span class="lineNum">     108</span>              :     { };</span>
<span id="L109"><span class="lineNum">     109</span>              : </span>
<span id="L110"><span class="lineNum">     110</span>              :   /// Specialization of common_type for two identical chrono::duration types.</span>
<span id="L111"><span class="lineNum">     111</span>              :   template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L112"><span class="lineNum">     112</span>              :     struct common_type&lt;chrono::duration&lt;_Rep, _Period&gt;,</span>
<span id="L113"><span class="lineNum">     113</span>              :                        chrono::duration&lt;_Rep, _Period&gt;&gt;</span>
<span id="L114"><span class="lineNum">     114</span>              :     {</span>
<span id="L115"><span class="lineNum">     115</span>              :       using type = chrono::duration&lt;typename common_type&lt;_Rep&gt;::type,</span>
<span id="L116"><span class="lineNum">     116</span>              :                                     typename _Period::type&gt;;</span>
<span id="L117"><span class="lineNum">     117</span>              :     };</span>
<span id="L118"><span class="lineNum">     118</span>              : </span>
<span id="L119"><span class="lineNum">     119</span>              :   /// Specialization of common_type for one chrono::duration type.</span>
<span id="L120"><span class="lineNum">     120</span>              :   template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L121"><span class="lineNum">     121</span>              :     struct common_type&lt;chrono::duration&lt;_Rep, _Period&gt;&gt;</span>
<span id="L122"><span class="lineNum">     122</span>              :     {</span>
<span id="L123"><span class="lineNum">     123</span>              :       using type = chrono::duration&lt;typename common_type&lt;_Rep&gt;::type,</span>
<span id="L124"><span class="lineNum">     124</span>              :                                     typename _Period::type&gt;;</span>
<span id="L125"><span class="lineNum">     125</span>              :     };</span>
<span id="L126"><span class="lineNum">     126</span>              :   /// @}</span>
<span id="L127"><span class="lineNum">     127</span>              : </span>
<span id="L128"><span class="lineNum">     128</span>              :   // 20.11.4.3 specialization of common_type (for time_point, sfinae-friendly)</span>
<span id="L129"><span class="lineNum">     129</span>              : </span>
<span id="L130"><span class="lineNum">     130</span>              :   /// @cond undocumented</span>
<span id="L131"><span class="lineNum">     131</span>              : </span>
<span id="L132"><span class="lineNum">     132</span>              :   template&lt;typename _CT, typename _Clock, typename = void&gt;</span>
<span id="L133"><span class="lineNum">     133</span>              :     struct __timepoint_common_type</span>
<span id="L134"><span class="lineNum">     134</span>              :     { };</span>
<span id="L135"><span class="lineNum">     135</span>              : </span>
<span id="L136"><span class="lineNum">     136</span>              :   template&lt;typename _CT, typename _Clock&gt;</span>
<span id="L137"><span class="lineNum">     137</span>              :     struct __timepoint_common_type&lt;_CT, _Clock, __void_t&lt;typename _CT::type&gt;&gt;</span>
<span id="L138"><span class="lineNum">     138</span>              :     {</span>
<span id="L139"><span class="lineNum">     139</span>              :       using type = chrono::time_point&lt;_Clock, typename _CT::type&gt;;</span>
<span id="L140"><span class="lineNum">     140</span>              :     };</span>
<span id="L141"><span class="lineNum">     141</span>              : </span>
<span id="L142"><span class="lineNum">     142</span>              :   /// @endcond</span>
<span id="L143"><span class="lineNum">     143</span>              : </span>
<span id="L144"><span class="lineNum">     144</span>              :   /// @{</span>
<span id="L145"><span class="lineNum">     145</span>              :   /// @relates chrono::time_point</span>
<span id="L146"><span class="lineNum">     146</span>              : </span>
<span id="L147"><span class="lineNum">     147</span>              :   /// Specialization of common_type for chrono::time_point types.</span>
<span id="L148"><span class="lineNum">     148</span>              :   template&lt;typename _Clock, typename _Duration1, typename _Duration2&gt;</span>
<span id="L149"><span class="lineNum">     149</span>              :     struct common_type&lt;chrono::time_point&lt;_Clock, _Duration1&gt;,</span>
<span id="L150"><span class="lineNum">     150</span>              :                        chrono::time_point&lt;_Clock, _Duration2&gt;&gt;</span>
<span id="L151"><span class="lineNum">     151</span>              :     : __timepoint_common_type&lt;common_type&lt;_Duration1, _Duration2&gt;, _Clock&gt;</span>
<span id="L152"><span class="lineNum">     152</span>              :     { };</span>
<span id="L153"><span class="lineNum">     153</span>              : </span>
<span id="L154"><span class="lineNum">     154</span>              :   /// Specialization of common_type for two identical chrono::time_point types.</span>
<span id="L155"><span class="lineNum">     155</span>              :   template&lt;typename _Clock, typename _Duration&gt;</span>
<span id="L156"><span class="lineNum">     156</span>              :     struct common_type&lt;chrono::time_point&lt;_Clock, _Duration&gt;,</span>
<span id="L157"><span class="lineNum">     157</span>              :                        chrono::time_point&lt;_Clock, _Duration&gt;&gt;</span>
<span id="L158"><span class="lineNum">     158</span>              :     { using type = chrono::time_point&lt;_Clock, _Duration&gt;; };</span>
<span id="L159"><span class="lineNum">     159</span>              : </span>
<span id="L160"><span class="lineNum">     160</span>              :   /// Specialization of common_type for one chrono::time_point type.</span>
<span id="L161"><span class="lineNum">     161</span>              :   template&lt;typename _Clock, typename _Duration&gt;</span>
<span id="L162"><span class="lineNum">     162</span>              :     struct common_type&lt;chrono::time_point&lt;_Clock, _Duration&gt;&gt;</span>
<span id="L163"><span class="lineNum">     163</span>              :     { using type = chrono::time_point&lt;_Clock, _Duration&gt;; };</span>
<span id="L164"><span class="lineNum">     164</span>              :   /// @}</span>
<span id="L165"><span class="lineNum">     165</span>              : </span>
<span id="L166"><span class="lineNum">     166</span>              :   /// @} group chrono</span>
<span id="L167"><span class="lineNum">     167</span>              : </span>
<span id="L168"><span class="lineNum">     168</span>              :   namespace chrono</span>
<span id="L169"><span class="lineNum">     169</span>              :   {</span>
<span id="L170"><span class="lineNum">     170</span>              :     /// @addtogroup chrono</span>
<span id="L171"><span class="lineNum">     171</span>              :     /// @{</span>
<span id="L172"><span class="lineNum">     172</span>              : </span>
<span id="L173"><span class="lineNum">     173</span>              :     /// @cond undocumented</span>
<span id="L174"><span class="lineNum">     174</span>              : </span>
<span id="L175"><span class="lineNum">     175</span>              :     // Primary template for duration_cast impl.</span>
<span id="L176"><span class="lineNum">     176</span>              :     template&lt;typename _ToDur, typename _CF, typename _CR,</span>
<span id="L177"><span class="lineNum">     177</span>              :              bool _NumIsOne = false, bool _DenIsOne = false&gt;</span>
<span id="L178"><span class="lineNum">     178</span>              :       struct __duration_cast_impl</span>
<span id="L179"><span class="lineNum">     179</span>              :       {</span>
<span id="L180"><span class="lineNum">     180</span>              :         template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L181"><span class="lineNum">     181</span>              :           static constexpr _ToDur</span>
<span id="L182"><span class="lineNum">     182</span>              :           __cast(const duration&lt;_Rep, _Period&gt;&amp; __d)</span>
<span id="L183"><span class="lineNum">     183</span>              :           {</span>
<span id="L184"><span class="lineNum">     184</span>              :             typedef typename _ToDur::rep                        __to_rep;</span>
<span id="L185"><span class="lineNum">     185</span>              :             return _ToDur(static_cast&lt;__to_rep&gt;(static_cast&lt;_CR&gt;(__d.count())</span>
<span id="L186"><span class="lineNum">     186</span>              :               * static_cast&lt;_CR&gt;(_CF::num)</span>
<span id="L187"><span class="lineNum">     187</span>              :               / static_cast&lt;_CR&gt;(_CF::den)));</span>
<span id="L188"><span class="lineNum">     188</span>              :           }</span>
<span id="L189"><span class="lineNum">     189</span>              :       };</span>
<span id="L190"><span class="lineNum">     190</span>              : </span>
<span id="L191"><span class="lineNum">     191</span>              :     template&lt;typename _ToDur, typename _CF, typename _CR&gt;</span>
<span id="L192"><span class="lineNum">     192</span>              :       struct __duration_cast_impl&lt;_ToDur, _CF, _CR, true, true&gt;</span>
<span id="L193"><span class="lineNum">     193</span>              :       {</span>
<span id="L194"><span class="lineNum">     194</span>              :         template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L195"><span class="lineNum">     195</span>              :           static constexpr _ToDur</span>
<span id="L196"><span class="lineNum">     196</span>              :           __cast(const duration&lt;_Rep, _Period&gt;&amp; __d)</span>
<span id="L197"><span class="lineNum">     197</span>              :           {</span>
<span id="L198"><span class="lineNum">     198</span>              :             typedef typename _ToDur::rep                        __to_rep;</span>
<span id="L199"><span class="lineNum">     199</span>              :             return _ToDur(static_cast&lt;__to_rep&gt;(__d.count()));</span>
<span id="L200"><span class="lineNum">     200</span>              :           }</span>
<span id="L201"><span class="lineNum">     201</span>              :       };</span>
<span id="L202"><span class="lineNum">     202</span>              : </span>
<span id="L203"><span class="lineNum">     203</span>              :     template&lt;typename _ToDur, typename _CF, typename _CR&gt;</span>
<span id="L204"><span class="lineNum">     204</span>              :       struct __duration_cast_impl&lt;_ToDur, _CF, _CR, true, false&gt;</span>
<span id="L205"><span class="lineNum">     205</span>              :       {</span>
<span id="L206"><span class="lineNum">     206</span>              :         template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L207"><span class="lineNum">     207</span>              :           static constexpr _ToDur</span>
<span id="L208"><span class="lineNum">     208</span> <span class="tlaGNC tlaBgGNC">           2 :           __cast(const duration&lt;_Rep, _Period&gt;&amp; __d)</span></span>
<span id="L209"><span class="lineNum">     209</span>              :           {</span>
<span id="L210"><span class="lineNum">     210</span>              :             typedef typename _ToDur::rep                        __to_rep;</span>
<span id="L211"><span class="lineNum">     211</span> <span class="tlaGNC">           4 :             return _ToDur(static_cast&lt;__to_rep&gt;(</span></span>
<span id="L212"><span class="lineNum">     212</span> <span class="tlaGNC">           2 :               static_cast&lt;_CR&gt;(__d.count()) / static_cast&lt;_CR&gt;(_CF::den)));</span></span>
<span id="L213"><span class="lineNum">     213</span>              :           }</span>
<span id="L214"><span class="lineNum">     214</span>              :       };</span>
<span id="L215"><span class="lineNum">     215</span>              : </span>
<span id="L216"><span class="lineNum">     216</span>              :     template&lt;typename _ToDur, typename _CF, typename _CR&gt;</span>
<span id="L217"><span class="lineNum">     217</span>              :       struct __duration_cast_impl&lt;_ToDur, _CF, _CR, false, true&gt;</span>
<span id="L218"><span class="lineNum">     218</span>              :       {</span>
<span id="L219"><span class="lineNum">     219</span>              :         template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L220"><span class="lineNum">     220</span>              :           static constexpr _ToDur</span>
<span id="L221"><span class="lineNum">     221</span>              :           __cast(const duration&lt;_Rep, _Period&gt;&amp; __d)</span>
<span id="L222"><span class="lineNum">     222</span>              :           {</span>
<span id="L223"><span class="lineNum">     223</span>              :             typedef typename _ToDur::rep                        __to_rep;</span>
<span id="L224"><span class="lineNum">     224</span>              :             return _ToDur(static_cast&lt;__to_rep&gt;(</span>
<span id="L225"><span class="lineNum">     225</span>              :               static_cast&lt;_CR&gt;(__d.count()) * static_cast&lt;_CR&gt;(_CF::num)));</span>
<span id="L226"><span class="lineNum">     226</span>              :           }</span>
<span id="L227"><span class="lineNum">     227</span>              :       };</span>
<span id="L228"><span class="lineNum">     228</span>              : </span>
<span id="L229"><span class="lineNum">     229</span>              :     template&lt;typename _Tp&gt;</span>
<span id="L230"><span class="lineNum">     230</span>              :       struct __is_duration</span>
<span id="L231"><span class="lineNum">     231</span>              :       : std::false_type</span>
<span id="L232"><span class="lineNum">     232</span>              :       { };</span>
<span id="L233"><span class="lineNum">     233</span>              : </span>
<span id="L234"><span class="lineNum">     234</span>              :     template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L235"><span class="lineNum">     235</span>              :       struct __is_duration&lt;duration&lt;_Rep, _Period&gt;&gt;</span>
<span id="L236"><span class="lineNum">     236</span>              :       : std::true_type</span>
<span id="L237"><span class="lineNum">     237</span>              :       { };</span>
<span id="L238"><span class="lineNum">     238</span>              : </span>
<span id="L239"><span class="lineNum">     239</span>              :     template&lt;typename _Tp&gt;</span>
<span id="L240"><span class="lineNum">     240</span>              :       using __enable_if_is_duration</span>
<span id="L241"><span class="lineNum">     241</span>              :         = typename enable_if&lt;__is_duration&lt;_Tp&gt;::value, _Tp&gt;::type;</span>
<span id="L242"><span class="lineNum">     242</span>              : </span>
<span id="L243"><span class="lineNum">     243</span>              :     template&lt;typename _Tp&gt;</span>
<span id="L244"><span class="lineNum">     244</span>              :       using __disable_if_is_duration</span>
<span id="L245"><span class="lineNum">     245</span>              :         = typename enable_if&lt;!__is_duration&lt;_Tp&gt;::value, _Tp&gt;::type;</span>
<span id="L246"><span class="lineNum">     246</span>              : </span>
<span id="L247"><span class="lineNum">     247</span>              : #if __cplusplus &gt;= 201703L</span>
<span id="L248"><span class="lineNum">     248</span>              :     template&lt;typename _Tp&gt;</span>
<span id="L249"><span class="lineNum">     249</span>              :       inline constexpr bool __is_duration_v = false;</span>
<span id="L250"><span class="lineNum">     250</span>              :     template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L251"><span class="lineNum">     251</span>              :       inline constexpr bool __is_duration_v&lt;duration&lt;_Rep, _Period&gt;&gt; = true;</span>
<span id="L252"><span class="lineNum">     252</span>              :     template&lt;typename _Tp&gt;</span>
<span id="L253"><span class="lineNum">     253</span>              :       inline constexpr bool __is_time_point_v = false;</span>
<span id="L254"><span class="lineNum">     254</span>              :     template&lt;typename _Clock, typename _Dur&gt;</span>
<span id="L255"><span class="lineNum">     255</span>              :       inline constexpr bool __is_time_point_v&lt;time_point&lt;_Clock, _Dur&gt;&gt; = true;</span>
<span id="L256"><span class="lineNum">     256</span>              : #endif</span>
<span id="L257"><span class="lineNum">     257</span>              : </span>
<span id="L258"><span class="lineNum">     258</span>              :     /// @endcond</span>
<span id="L259"><span class="lineNum">     259</span>              : </span>
<span id="L260"><span class="lineNum">     260</span>              :     /** Convert a `duration` to type `ToDur`.</span>
<span id="L261"><span class="lineNum">     261</span>              :      *</span>
<span id="L262"><span class="lineNum">     262</span>              :      * If the duration cannot be represented accurately in the result type,</span>
<span id="L263"><span class="lineNum">     263</span>              :      * returns the result of integer truncation (i.e., rounded towards zero).</span>
<span id="L264"><span class="lineNum">     264</span>              :      *</span>
<span id="L265"><span class="lineNum">     265</span>              :      * @tparam _ToDur The result type must be a `duration`.</span>
<span id="L266"><span class="lineNum">     266</span>              :      * @param __d A duration.</span>
<span id="L267"><span class="lineNum">     267</span>              :      * @return The value of `__d` converted to type `_ToDur`.</span>
<span id="L268"><span class="lineNum">     268</span>              :      * @since C++11</span>
<span id="L269"><span class="lineNum">     269</span>              :      */</span>
<span id="L270"><span class="lineNum">     270</span>              :     template&lt;typename _ToDur, typename _Rep, typename _Period&gt;</span>
<span id="L271"><span class="lineNum">     271</span>              :       _GLIBCXX_NODISCARD</span>
<span id="L272"><span class="lineNum">     272</span>              :       constexpr __enable_if_is_duration&lt;_ToDur&gt;</span>
<span id="L273"><span class="lineNum">     273</span> <span class="tlaGNC">           2 :       duration_cast(const duration&lt;_Rep, _Period&gt;&amp; __d)</span></span>
<span id="L274"><span class="lineNum">     274</span>              :       {</span>
<span id="L275"><span class="lineNum">     275</span>              : #if __cpp_inline_variables &amp;&amp; __cpp_if_constexpr</span>
<span id="L276"><span class="lineNum">     276</span>              :         if constexpr (is_same_v&lt;_ToDur, duration&lt;_Rep, _Period&gt;&gt;)</span>
<span id="L277"><span class="lineNum">     277</span>              :           return __d;</span>
<span id="L278"><span class="lineNum">     278</span>              :         else</span>
<span id="L279"><span class="lineNum">     279</span>              :           {</span>
<span id="L280"><span class="lineNum">     280</span>              : #endif</span>
<span id="L281"><span class="lineNum">     281</span>              :           using __to_period = typename _ToDur::period;</span>
<span id="L282"><span class="lineNum">     282</span>              :           using __to_rep = typename _ToDur::rep;</span>
<span id="L283"><span class="lineNum">     283</span>              :           using __cf = ratio_divide&lt;_Period, __to_period&gt;;</span>
<span id="L284"><span class="lineNum">     284</span>              :           using __cr = typename common_type&lt;__to_rep, _Rep, intmax_t&gt;::type;</span>
<span id="L285"><span class="lineNum">     285</span>              :           using __dc = __duration_cast_impl&lt;_ToDur, __cf, __cr,</span>
<span id="L286"><span class="lineNum">     286</span>              :                                             __cf::num == 1, __cf::den == 1&gt;;</span>
<span id="L287"><span class="lineNum">     287</span> <span class="tlaGNC">           2 :           return __dc::__cast(__d);</span></span>
<span id="L288"><span class="lineNum">     288</span>              : #if __cpp_inline_variables &amp;&amp; __cpp_if_constexpr</span>
<span id="L289"><span class="lineNum">     289</span>              :           }</span>
<span id="L290"><span class="lineNum">     290</span>              : #endif</span>
<span id="L291"><span class="lineNum">     291</span>              :       }</span>
<span id="L292"><span class="lineNum">     292</span>              : </span>
<span id="L293"><span class="lineNum">     293</span>              :     /** Trait indicating whether to treat a type as a floating-point type.</span>
<span id="L294"><span class="lineNum">     294</span>              :      *</span>
<span id="L295"><span class="lineNum">     295</span>              :      * The chrono library uses this trait to tell whether a `duration` can</span>
<span id="L296"><span class="lineNum">     296</span>              :      * represent fractional values of the given precision, or only integral</span>
<span id="L297"><span class="lineNum">     297</span>              :      * values.</span>
<span id="L298"><span class="lineNum">     298</span>              :      *</span>
<span id="L299"><span class="lineNum">     299</span>              :      * You should specialize this trait for your own numeric types that are</span>
<span id="L300"><span class="lineNum">     300</span>              :      * used with `duration` and can represent non-integral values.</span>
<span id="L301"><span class="lineNum">     301</span>              :      *</span>
<span id="L302"><span class="lineNum">     302</span>              :      * @since C++11</span>
<span id="L303"><span class="lineNum">     303</span>              :      */</span>
<span id="L304"><span class="lineNum">     304</span>              :     template&lt;typename _Rep&gt;</span>
<span id="L305"><span class="lineNum">     305</span>              :       struct treat_as_floating_point</span>
<span id="L306"><span class="lineNum">     306</span>              :       : is_floating_point&lt;_Rep&gt;</span>
<span id="L307"><span class="lineNum">     307</span>              :       { };</span>
<span id="L308"><span class="lineNum">     308</span>              : </span>
<span id="L309"><span class="lineNum">     309</span>              : #if __cplusplus &gt; 201402L</span>
<span id="L310"><span class="lineNum">     310</span>              :     template &lt;typename _Rep&gt;</span>
<span id="L311"><span class="lineNum">     311</span>              :       inline constexpr bool treat_as_floating_point_v =</span>
<span id="L312"><span class="lineNum">     312</span>              :         treat_as_floating_point&lt;_Rep&gt;::value;</span>
<span id="L313"><span class="lineNum">     313</span>              : </span>
<span id="L314"><span class="lineNum">     314</span>              :     template&lt;&gt;</span>
<span id="L315"><span class="lineNum">     315</span>              :       inline constexpr bool treat_as_floating_point_v&lt;int&gt; = false;</span>
<span id="L316"><span class="lineNum">     316</span>              :     template&lt;&gt;</span>
<span id="L317"><span class="lineNum">     317</span>              :       inline constexpr bool treat_as_floating_point_v&lt;long&gt; = false;</span>
<span id="L318"><span class="lineNum">     318</span>              :     template&lt;&gt;</span>
<span id="L319"><span class="lineNum">     319</span>              :       inline constexpr bool treat_as_floating_point_v&lt;long long&gt; = false;</span>
<span id="L320"><span class="lineNum">     320</span>              :     template&lt;&gt;</span>
<span id="L321"><span class="lineNum">     321</span>              :       inline constexpr bool treat_as_floating_point_v&lt;float&gt; = true;</span>
<span id="L322"><span class="lineNum">     322</span>              :     template&lt;&gt;</span>
<span id="L323"><span class="lineNum">     323</span>              :       inline constexpr bool treat_as_floating_point_v&lt;double&gt; = true;</span>
<span id="L324"><span class="lineNum">     324</span>              :     template&lt;&gt;</span>
<span id="L325"><span class="lineNum">     325</span>              :       inline constexpr bool treat_as_floating_point_v&lt;long double&gt; = true;</span>
<span id="L326"><span class="lineNum">     326</span>              : #endif // C++17</span>
<span id="L327"><span class="lineNum">     327</span>              : </span>
<span id="L328"><span class="lineNum">     328</span>              : #if __cplusplus &gt; 201703L</span>
<span id="L329"><span class="lineNum">     329</span>              : #if __cpp_lib_concepts</span>
<span id="L330"><span class="lineNum">     330</span>              :     template&lt;typename _Tp&gt;</span>
<span id="L331"><span class="lineNum">     331</span>              :       inline constexpr bool is_clock_v = false;</span>
<span id="L332"><span class="lineNum">     332</span>              : </span>
<span id="L333"><span class="lineNum">     333</span>              :     template&lt;typename _Tp&gt;</span>
<span id="L334"><span class="lineNum">     334</span>              :       requires requires {</span>
<span id="L335"><span class="lineNum">     335</span>              :         typename _Tp::rep;</span>
<span id="L336"><span class="lineNum">     336</span>              :         typename _Tp::period;</span>
<span id="L337"><span class="lineNum">     337</span>              :         typename _Tp::duration;</span>
<span id="L338"><span class="lineNum">     338</span>              :         typename _Tp::time_point::clock;</span>
<span id="L339"><span class="lineNum">     339</span>              :         typename _Tp::time_point::duration;</span>
<span id="L340"><span class="lineNum">     340</span>              :         { &amp;_Tp::is_steady } -&gt; same_as&lt;const bool*&gt;;</span>
<span id="L341"><span class="lineNum">     341</span>              :         { _Tp::now() } -&gt; same_as&lt;typename _Tp::time_point&gt;;</span>
<span id="L342"><span class="lineNum">     342</span>              :         requires same_as&lt;typename _Tp::duration,</span>
<span id="L343"><span class="lineNum">     343</span>              :                          duration&lt;typename _Tp::rep, typename _Tp::period&gt;&gt;;</span>
<span id="L344"><span class="lineNum">     344</span>              :         requires same_as&lt;typename _Tp::time_point::duration,</span>
<span id="L345"><span class="lineNum">     345</span>              :                          typename _Tp::duration&gt;;</span>
<span id="L346"><span class="lineNum">     346</span>              :       }</span>
<span id="L347"><span class="lineNum">     347</span>              :     inline constexpr bool is_clock_v&lt;_Tp&gt; = true;</span>
<span id="L348"><span class="lineNum">     348</span>              : #else</span>
<span id="L349"><span class="lineNum">     349</span>              :     template&lt;typename _Tp, typename = void&gt;</span>
<span id="L350"><span class="lineNum">     350</span>              :       inline constexpr bool is_clock_v = false;</span>
<span id="L351"><span class="lineNum">     351</span>              : </span>
<span id="L352"><span class="lineNum">     352</span>              :     template&lt;typename _Tp&gt;</span>
<span id="L353"><span class="lineNum">     353</span>              :       inline constexpr bool</span>
<span id="L354"><span class="lineNum">     354</span>              :       is_clock_v&lt;_Tp, void_t&lt;typename _Tp::rep, typename _Tp::period,</span>
<span id="L355"><span class="lineNum">     355</span>              :                              typename _Tp::duration,</span>
<span id="L356"><span class="lineNum">     356</span>              :                              typename _Tp::time_point::duration,</span>
<span id="L357"><span class="lineNum">     357</span>              :                              decltype(_Tp::is_steady),</span>
<span id="L358"><span class="lineNum">     358</span>              :                              decltype(_Tp::now())&gt;&gt;</span>
<span id="L359"><span class="lineNum">     359</span>              :         = __and_v&lt;is_same&lt;typename _Tp::duration,</span>
<span id="L360"><span class="lineNum">     360</span>              :                           duration&lt;typename _Tp::rep, typename _Tp::period&gt;&gt;,</span>
<span id="L361"><span class="lineNum">     361</span>              :                   is_same&lt;typename _Tp::time_point::duration,</span>
<span id="L362"><span class="lineNum">     362</span>              :                           typename _Tp::duration&gt;,</span>
<span id="L363"><span class="lineNum">     363</span>              :                   is_same&lt;decltype(&amp;_Tp::is_steady), const bool*&gt;,</span>
<span id="L364"><span class="lineNum">     364</span>              :                   is_same&lt;decltype(_Tp::now()), typename _Tp::time_point&gt;&gt;;</span>
<span id="L365"><span class="lineNum">     365</span>              : #endif</span>
<span id="L366"><span class="lineNum">     366</span>              : </span>
<span id="L367"><span class="lineNum">     367</span>              :     template&lt;typename _Tp&gt;</span>
<span id="L368"><span class="lineNum">     368</span>              :       struct is_clock</span>
<span id="L369"><span class="lineNum">     369</span>              :       : bool_constant&lt;is_clock_v&lt;_Tp&gt;&gt;</span>
<span id="L370"><span class="lineNum">     370</span>              :       { };</span>
<span id="L371"><span class="lineNum">     371</span>              : #endif // C++20</span>
<span id="L372"><span class="lineNum">     372</span>              : </span>
<span id="L373"><span class="lineNum">     373</span>              : #if __cplusplus &gt;= 201703L</span>
<span id="L374"><span class="lineNum">     374</span>              : # define __cpp_lib_chrono 201611L</span>
<span id="L375"><span class="lineNum">     375</span>              : </span>
<span id="L376"><span class="lineNum">     376</span>              :     /** Convert a `duration` to type `ToDur` and round down.</span>
<span id="L377"><span class="lineNum">     377</span>              :      *</span>
<span id="L378"><span class="lineNum">     378</span>              :      * If the duration cannot be represented exactly in the result type,</span>
<span id="L379"><span class="lineNum">     379</span>              :      * returns the closest value that is less than the argument.</span>
<span id="L380"><span class="lineNum">     380</span>              :      *</span>
<span id="L381"><span class="lineNum">     381</span>              :      * @tparam _ToDur The result type must be a `duration`.</span>
<span id="L382"><span class="lineNum">     382</span>              :      * @param __d A duration.</span>
<span id="L383"><span class="lineNum">     383</span>              :      * @return The value of `__d` converted to type `_ToDur`.</span>
<span id="L384"><span class="lineNum">     384</span>              :      * @since C++17</span>
<span id="L385"><span class="lineNum">     385</span>              :      */</span>
<span id="L386"><span class="lineNum">     386</span>              :     template&lt;typename _ToDur, typename _Rep, typename _Period&gt;</span>
<span id="L387"><span class="lineNum">     387</span>              :       [[nodiscard]] constexpr __enable_if_is_duration&lt;_ToDur&gt;</span>
<span id="L388"><span class="lineNum">     388</span>              :       floor(const duration&lt;_Rep, _Period&gt;&amp; __d)</span>
<span id="L389"><span class="lineNum">     389</span>              :       {</span>
<span id="L390"><span class="lineNum">     390</span>              :         auto __to = chrono::duration_cast&lt;_ToDur&gt;(__d);</span>
<span id="L391"><span class="lineNum">     391</span>              :         if (__to &gt; __d)</span>
<span id="L392"><span class="lineNum">     392</span>              :           return __to - _ToDur{1};</span>
<span id="L393"><span class="lineNum">     393</span>              :         return __to;</span>
<span id="L394"><span class="lineNum">     394</span>              :       }</span>
<span id="L395"><span class="lineNum">     395</span>              : </span>
<span id="L396"><span class="lineNum">     396</span>              :     /** Convert a `duration` to type `ToDur` and round up.</span>
<span id="L397"><span class="lineNum">     397</span>              :      *</span>
<span id="L398"><span class="lineNum">     398</span>              :      * If the duration cannot be represented exactly in the result type,</span>
<span id="L399"><span class="lineNum">     399</span>              :      * returns the closest value that is greater than the argument.</span>
<span id="L400"><span class="lineNum">     400</span>              :      *</span>
<span id="L401"><span class="lineNum">     401</span>              :      * @tparam _ToDur The result type must be a `duration`.</span>
<span id="L402"><span class="lineNum">     402</span>              :      * @param __d A duration.</span>
<span id="L403"><span class="lineNum">     403</span>              :      * @return The value of `__d` converted to type `_ToDur`.</span>
<span id="L404"><span class="lineNum">     404</span>              :      * @since C++17</span>
<span id="L405"><span class="lineNum">     405</span>              :      */</span>
<span id="L406"><span class="lineNum">     406</span>              :     template&lt;typename _ToDur, typename _Rep, typename _Period&gt;</span>
<span id="L407"><span class="lineNum">     407</span>              :       [[nodiscard]] constexpr __enable_if_is_duration&lt;_ToDur&gt;</span>
<span id="L408"><span class="lineNum">     408</span>              :       ceil(const duration&lt;_Rep, _Period&gt;&amp; __d)</span>
<span id="L409"><span class="lineNum">     409</span>              :       {</span>
<span id="L410"><span class="lineNum">     410</span>              :         auto __to = chrono::duration_cast&lt;_ToDur&gt;(__d);</span>
<span id="L411"><span class="lineNum">     411</span>              :         if (__to &lt; __d)</span>
<span id="L412"><span class="lineNum">     412</span>              :           return __to + _ToDur{1};</span>
<span id="L413"><span class="lineNum">     413</span>              :         return __to;</span>
<span id="L414"><span class="lineNum">     414</span>              :       }</span>
<span id="L415"><span class="lineNum">     415</span>              : </span>
<span id="L416"><span class="lineNum">     416</span>              :     /** Convert a `duration` to type `ToDur` and round to the closest value.</span>
<span id="L417"><span class="lineNum">     417</span>              :      *</span>
<span id="L418"><span class="lineNum">     418</span>              :      * If the duration cannot be represented exactly in the result type,</span>
<span id="L419"><span class="lineNum">     419</span>              :      * returns the closest value, rounding ties to even.</span>
<span id="L420"><span class="lineNum">     420</span>              :      *</span>
<span id="L421"><span class="lineNum">     421</span>              :      * @tparam _ToDur The result type must be a `duration` with a</span>
<span id="L422"><span class="lineNum">     422</span>              :      *                non-floating-point `rep` type.</span>
<span id="L423"><span class="lineNum">     423</span>              :      * @param __d A duration.</span>
<span id="L424"><span class="lineNum">     424</span>              :      * @return The value of `__d` converted to type `_ToDur`.</span>
<span id="L425"><span class="lineNum">     425</span>              :      * @since C++17</span>
<span id="L426"><span class="lineNum">     426</span>              :      */</span>
<span id="L427"><span class="lineNum">     427</span>              :     template &lt;typename _ToDur, typename _Rep, typename _Period&gt;</span>
<span id="L428"><span class="lineNum">     428</span>              :       [[nodiscard]] constexpr</span>
<span id="L429"><span class="lineNum">     429</span>              :       enable_if_t&lt;</span>
<span id="L430"><span class="lineNum">     430</span>              :         __and_&lt;__is_duration&lt;_ToDur&gt;,</span>
<span id="L431"><span class="lineNum">     431</span>              :                __not_&lt;treat_as_floating_point&lt;typename _ToDur::rep&gt;&gt;&gt;::value,</span>
<span id="L432"><span class="lineNum">     432</span>              :         _ToDur&gt;</span>
<span id="L433"><span class="lineNum">     433</span>              :       round(const duration&lt;_Rep, _Period&gt;&amp; __d)</span>
<span id="L434"><span class="lineNum">     434</span>              :       {</span>
<span id="L435"><span class="lineNum">     435</span>              :         _ToDur __t0 = chrono::floor&lt;_ToDur&gt;(__d);</span>
<span id="L436"><span class="lineNum">     436</span>              :         _ToDur __t1 = __t0 + _ToDur{1};</span>
<span id="L437"><span class="lineNum">     437</span>              :         auto __diff0 = __d - __t0;</span>
<span id="L438"><span class="lineNum">     438</span>              :         auto __diff1 = __t1 - __d;</span>
<span id="L439"><span class="lineNum">     439</span>              :         if (__diff0 == __diff1)</span>
<span id="L440"><span class="lineNum">     440</span>              :           {</span>
<span id="L441"><span class="lineNum">     441</span>              :             if (__t0.count() &amp; 1)</span>
<span id="L442"><span class="lineNum">     442</span>              :               return __t1;</span>
<span id="L443"><span class="lineNum">     443</span>              :             return __t0;</span>
<span id="L444"><span class="lineNum">     444</span>              :           }</span>
<span id="L445"><span class="lineNum">     445</span>              :         else if (__diff0 &lt; __diff1)</span>
<span id="L446"><span class="lineNum">     446</span>              :           return __t0;</span>
<span id="L447"><span class="lineNum">     447</span>              :         return __t1;</span>
<span id="L448"><span class="lineNum">     448</span>              :       }</span>
<span id="L449"><span class="lineNum">     449</span>              : </span>
<span id="L450"><span class="lineNum">     450</span>              :     /** The absolute (non-negative) value of a duration.</span>
<span id="L451"><span class="lineNum">     451</span>              :      *</span>
<span id="L452"><span class="lineNum">     452</span>              :      * @param __d A duration with a signed `rep` type.</span>
<span id="L453"><span class="lineNum">     453</span>              :      * @return A duration of the same type as the argument, with value |d|.</span>
<span id="L454"><span class="lineNum">     454</span>              :      * @since C++17</span>
<span id="L455"><span class="lineNum">     455</span>              :      */</span>
<span id="L456"><span class="lineNum">     456</span>              :     template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L457"><span class="lineNum">     457</span>              :       [[nodiscard]] constexpr</span>
<span id="L458"><span class="lineNum">     458</span>              :       enable_if_t&lt;numeric_limits&lt;_Rep&gt;::is_signed, duration&lt;_Rep, _Period&gt;&gt;</span>
<span id="L459"><span class="lineNum">     459</span>              :       abs(duration&lt;_Rep, _Period&gt; __d)</span>
<span id="L460"><span class="lineNum">     460</span>              :       {</span>
<span id="L461"><span class="lineNum">     461</span>              :         if (__d &gt;= __d.zero())</span>
<span id="L462"><span class="lineNum">     462</span>              :           return __d;</span>
<span id="L463"><span class="lineNum">     463</span>              :         return -__d;</span>
<span id="L464"><span class="lineNum">     464</span>              :       }</span>
<span id="L465"><span class="lineNum">     465</span>              : </span>
<span id="L466"><span class="lineNum">     466</span>              :     // Make chrono::ceil&lt;D&gt; also usable as chrono::__detail::ceil&lt;D&gt;.</span>
<span id="L467"><span class="lineNum">     467</span>              :     namespace __detail { using chrono::ceil; }</span>
<span id="L468"><span class="lineNum">     468</span>              : </span>
<span id="L469"><span class="lineNum">     469</span>              : #else // ! C++17</span>
<span id="L470"><span class="lineNum">     470</span>              : </span>
<span id="L471"><span class="lineNum">     471</span>              :     // We want to use ceil even when compiling for earlier standards versions.</span>
<span id="L472"><span class="lineNum">     472</span>              :     // C++11 only allows a single statement in a constexpr function, so we</span>
<span id="L473"><span class="lineNum">     473</span>              :     // need to move the comparison into a separate function, __ceil_impl.</span>
<span id="L474"><span class="lineNum">     474</span>              :     namespace __detail</span>
<span id="L475"><span class="lineNum">     475</span>              :     {</span>
<span id="L476"><span class="lineNum">     476</span>              :       template&lt;typename _Tp, typename _Up&gt;</span>
<span id="L477"><span class="lineNum">     477</span>              :         constexpr _Tp</span>
<span id="L478"><span class="lineNum">     478</span>              :         __ceil_impl(const _Tp&amp; __t, const _Up&amp; __u)</span>
<span id="L479"><span class="lineNum">     479</span>              :         {</span>
<span id="L480"><span class="lineNum">     480</span>              :           return (__t &lt; __u) ? (__t + _Tp{1}) : __t;</span>
<span id="L481"><span class="lineNum">     481</span>              :         }</span>
<span id="L482"><span class="lineNum">     482</span>              : </span>
<span id="L483"><span class="lineNum">     483</span>              :       // C++11-friendly version of std::chrono::ceil&lt;D&gt; for internal use.</span>
<span id="L484"><span class="lineNum">     484</span>              :       template&lt;typename _ToDur, typename _Rep, typename _Period&gt;</span>
<span id="L485"><span class="lineNum">     485</span>              :         constexpr _ToDur</span>
<span id="L486"><span class="lineNum">     486</span>              :         ceil(const duration&lt;_Rep, _Period&gt;&amp; __d)</span>
<span id="L487"><span class="lineNum">     487</span>              :         {</span>
<span id="L488"><span class="lineNum">     488</span>              :           return __detail::__ceil_impl(chrono::duration_cast&lt;_ToDur&gt;(__d), __d);</span>
<span id="L489"><span class="lineNum">     489</span>              :         }</span>
<span id="L490"><span class="lineNum">     490</span>              :     }</span>
<span id="L491"><span class="lineNum">     491</span>              : #endif // C++17</span>
<span id="L492"><span class="lineNum">     492</span>              : </span>
<span id="L493"><span class="lineNum">     493</span>              :     /// duration_values</span>
<span id="L494"><span class="lineNum">     494</span>              :     template&lt;typename _Rep&gt;</span>
<span id="L495"><span class="lineNum">     495</span>              :       struct duration_values</span>
<span id="L496"><span class="lineNum">     496</span>              :       {</span>
<span id="L497"><span class="lineNum">     497</span>              :         static constexpr _Rep</span>
<span id="L498"><span class="lineNum">     498</span>              :         zero() noexcept</span>
<span id="L499"><span class="lineNum">     499</span>              :         { return _Rep(0); }</span>
<span id="L500"><span class="lineNum">     500</span>              : </span>
<span id="L501"><span class="lineNum">     501</span>              :         static constexpr _Rep</span>
<span id="L502"><span class="lineNum">     502</span>              :         max() noexcept</span>
<span id="L503"><span class="lineNum">     503</span>              :         { return numeric_limits&lt;_Rep&gt;::max(); }</span>
<span id="L504"><span class="lineNum">     504</span>              : </span>
<span id="L505"><span class="lineNum">     505</span>              :         static constexpr _Rep</span>
<span id="L506"><span class="lineNum">     506</span>              :         min() noexcept</span>
<span id="L507"><span class="lineNum">     507</span>              :         { return numeric_limits&lt;_Rep&gt;::lowest(); }</span>
<span id="L508"><span class="lineNum">     508</span>              :       };</span>
<span id="L509"><span class="lineNum">     509</span>              : </span>
<span id="L510"><span class="lineNum">     510</span>              :     template&lt;typename _Rep, typename _Period&gt;</span>
<span id="L511"><span class="lineNum">     511</span>              :       class duration</span>
<span id="L512"><span class="lineNum">     512</span>              :       {</span>
<span id="L513"><span class="lineNum">     513</span>              :         static_assert(!__is_duration&lt;_Rep&gt;::value,</span>
<span id="L514"><span class="lineNum">     514</span>              :                       &quot;rep cannot be a std::chrono::duration&quot;);</span>
<span id="L515"><span class="lineNum">     515</span>              :         static_assert(__is_ratio&lt;_Period&gt;::value,</span>
<span id="L516"><span class="lineNum">     516</span>              :                       &quot;period must be a specialization of std::ratio&quot;);</span>
<span id="L517"><span class="lineNum">     517</span>              :         static_assert(_Period::num &gt; 0, &quot;period must be positive&quot;);</span>
<span id="L518"><span class="lineNum">     518</span>              : </span>
<span id="L519"><span class="lineNum">     519</span>              :         template&lt;typename _Rep2&gt;</span>
<span id="L520"><span class="lineNum">     520</span>              :           using __is_float = treat_as_floating_point&lt;_Rep2&gt;;</span>
<span id="L521"><span class="lineNum">     521</span>              : </span>
<span id="L522"><span class="lineNum">     522</span>              :         static constexpr intmax_t</span>
<span id="L523"><span class="lineNum">     523</span>              :         _S_gcd(intmax_t __m, intmax_t __n) noexcept</span>
<span id="L524"><span class="lineNum">     524</span>              :         {</span>
<span id="L525"><span class="lineNum">     525</span>              :           // Duration only allows positive periods so we don't need to</span>
<span id="L526"><span class="lineNum">     526</span>              :           // handle negative values here (unlike __static_gcd and std::gcd).</span>
<span id="L527"><span class="lineNum">     527</span>              : #if __cplusplus &gt;= 201402L</span>
<span id="L528"><span class="lineNum">     528</span>              :           do</span>
<span id="L529"><span class="lineNum">     529</span>              :             {</span>
<span id="L530"><span class="lineNum">     530</span>              :               intmax_t __rem = __m % __n;</span>
<span id="L531"><span class="lineNum">     531</span>              :               __m = __n;</span>
<span id="L532"><span class="lineNum">     532</span>              :               __n = __rem;</span>
<span id="L533"><span class="lineNum">     533</span>              :             }</span>
<span id="L534"><span class="lineNum">     534</span>              :           while (__n != 0);</span>
<span id="L535"><span class="lineNum">     535</span>              :           return __m;</span>
<span id="L536"><span class="lineNum">     536</span>              : #else</span>
<span id="L537"><span class="lineNum">     537</span>              :           // C++11 doesn't allow loops in constexpr functions, but this</span>
<span id="L538"><span class="lineNum">     538</span>              :           // recursive version can be more expensive to evaluate.</span>
<span id="L539"><span class="lineNum">     539</span>              :           return (__n == 0) ? __m : _S_gcd(__n, __m % __n);</span>
<span id="L540"><span class="lineNum">     540</span>              : #endif</span>
<span id="L541"><span class="lineNum">     541</span>              :         }</span>
<span id="L542"><span class="lineNum">     542</span>              : </span>
<span id="L543"><span class="lineNum">     543</span>              :         // _GLIBCXX_RESOLVE_LIB_DEFECTS</span>
<span id="L544"><span class="lineNum">     544</span>              :         // 2094. overflow shouldn't participate in overload resolution</span>
<span id="L545"><span class="lineNum">     545</span>              :         // 3090. What is [2094] intended to mean?</span>
<span id="L546"><span class="lineNum">     546</span>              :         // This only produces a valid type if no overflow occurs.</span>
<span id="L547"><span class="lineNum">     547</span>              :         template&lt;typename _R1, typename _R2,</span>
<span id="L548"><span class="lineNum">     548</span>              :                  intmax_t __gcd1 = _S_gcd(_R1::num, _R2::num),</span>
<span id="L549"><span class="lineNum">     549</span>              :                  intmax_t __gcd2 = _S_gcd(_R1::den, _R2::den)&gt;</span>
<span id="L550"><span class="lineNum">     550</span>              :           using __divide = ratio&lt;(_R1::num / __gcd1) * (_R2::den / __gcd2),</span>
<span id="L551"><span class="lineNum">     551</span>              :                                  (_R1::den / __gcd2) * (_R2::num / __gcd1)&gt;;</span>
<span id="L552"><span class="lineNum">     552</span>              : </span>
<span id="L553"><span class="lineNum">     553</span>              :         // _Period2 is an exact multiple of _Period</span>
<span id="L554"><span class="lineNum">     554</span>              :         template&lt;typename _Period2&gt;</span>
<span id="L555"><span class="lineNum">     555</span>              :           using __is_harmonic</span>
<span id="L556"><span class="lineNum">     556</span>              :             = __bool_constant&lt;__divide&lt;_Period2, _Period&gt;::den == 1&gt;;</span>
<span id="L557"><span class="lineNum">     557</span>              : </span>
<span id="L558"><span class="lineNum">     558</span>              :       public:</span>
<span id="L559"><span class="lineNum">     559</span>              : </span>
<span id="L560"><span class="lineNum">     560</span>              :         using rep = _Rep;</span>
<span id="L561"><span class="lineNum">     561</span>              :         using period = typename _Period::type;</span>
<span id="L562"><span class="lineNum">     562</span>              : </span>
<span id="L563"><span class="lineNum">     563</span>              :         // 20.11.5.1 construction / copy / destroy</span>
<span id="L564"><span class="lineNum">     564</span>              :         constexpr duration() = default;</span>
<span id="L565"><span class="lineNum">     565</span>              : </span>
<span id="L566"><span class="lineNum">     566</span>              :         duration(const duration&amp;) = default;</span>
<span id="L567"><span class="lineNum">     567</span>              : </span>
<span id="L568"><span class="lineNum">     568</span>              :         // _GLIBCXX_RESOLVE_LIB_DEFECTS</span>
<span id="L569"><span class="lineNum">     569</span>              :         // 3050. Conversion specification problem in chrono::duration</span>
<span id="L570"><span class="lineNum">     570</span>              :         template&lt;typename _Rep2, typename = _Require&lt;</span>
<span id="L571"><span class="lineNum">     571</span>              :                  is_convertible&lt;const _Rep2&amp;, rep&gt;,</span>
<span id="L572"><span class="lineNum">     572</span>              :                  __or_&lt;__is_float&lt;rep&gt;, __not_&lt;__is_float&lt;_Rep2&gt;&gt;&gt;&gt;&gt;</span>
<span id="L573"><span class="lineNum">     573</span> <span class="tlaGNC">           2 :           constexpr explicit duration(const _Rep2&amp; __rep)</span></span>
<span id="L574"><span class="lineNum">     574</span> <span class="tlaGNC">           2 :           : __r(static_cast&lt;rep&gt;(__rep)) { }</span></span>
<span id="L575"><span class="lineNum">     575</span>              : </span>
<span id="L576"><span class="lineNum">     576</span>              :         template&lt;typename _Rep2, typename _Period2, typename = _Require&lt;</span>
<span id="L577"><span class="lineNum">     577</span>              :                  is_convertible&lt;const _Rep2&amp;, rep&gt;,</span>
<span id="L578"><span class="lineNum">     578</span>              :                  __or_&lt;__is_float&lt;rep&gt;,</span>
<span id="L579"><span class="lineNum">     579</span>              :                        __and_&lt;__is_harmonic&lt;_Period2&gt;,</span>
<span id="L580"><span class="lineNum">     580</span>              :                               __not_&lt;__is_float&lt;_Rep2&gt;&gt;&gt;&gt;&gt;&gt;</span>
<span id="L581"><span class="lineNum">     581</span>              :           constexpr duration(const duration&lt;_Rep2, _Period2&gt;&amp; __d)</span>
<span id="L582"><span class="lineNum">     582</span>              :           : __r(duration_cast&lt;duration&gt;(__d).count()) { }</span>
<span id="L583"><span class="lineNum">     583</span>              : </span>
<span id="L584"><span class="lineNum">     584</span>              :         ~duration() = default;</span>
<span id="L585"><span class="lineNum">     585</span>              :         duration&amp; operator=(const duration&amp;) = default;</span>
<span id="L586"><span class="lineNum">     586</span>              : </span>
<span id="L587"><span class="lineNum">     587</span>              :         // 20.11.5.2 observer</span>
<span id="L588"><span class="lineNum">     588</span>              :         constexpr rep</span>
<span id="L589"><span class="lineNum">     589</span> <span class="tlaGNC">           4 :         count() const</span></span>
<span id="L590"><span class="lineNum">     590</span> <span class="tlaGNC">           4 :         { return __r; }</span></span>
<span id="L591"><span class="lineNum">     591</span>              : </span>
<span id="L592"><span class="lineNum">     592</span>              :         // 20.11.5.3 arithmetic</span>
<span id="L593"><span class="lineNum">     593</span>              : </span>
<span id="L594"><span class="lineNum">     594</span>              :         constexpr duration&lt;typename common_type&lt;rep&gt;::type, period&gt;</span>
<span id="L595"><span class="lineNum">     595</span>              :         operator+() const</span>
<span id="L596"><span class="lineNum">     596</span>              :         { return duration&lt;typename common_type&lt;rep&gt;::type, period&gt;(__r); }</span>
<span id="L597"><span class="lineNum">     597</span>              : </span>
<span id="L598"><span class="lineNum">     598</span>              :         constexpr duration&lt;typename common_type&lt;rep&gt;::type, period&gt;</span>
<span id="L599"><span class="lineNum">     599</span>              :         operator-() const</span>
<span id="L600"><span class="lineNum">     600</span>              :         { return duration&lt;typename common_type&lt;rep&gt;::type, period&gt;(-__r); }</span>
<span id="L601"><span class="lineNum">     601</span>              : </span>
<span id="L602"><span class="lineNum">     602</span>              :         _GLIBCXX17_CONSTEXPR duration&amp;</span>
<span id="L603"><span class="lineNum">     603</span>              :         operator++()</span>
<span id="L604"><span class="lineNum">     604</span>              :         {</span>
<span id="L605"><span class="lineNum">     605</span>              :           ++__r;</span>
<span id="L606"><span class="lineNum">     606</span>              :           return *this;</span>
<span id="L607"><span class="lineNum">     607</span>              :         }</span>
<span id="L608"><span class="lineNum">     608</span>              : </span>
<span id="L609"><span class="lineNum">     609</span>              :         _GLIBCXX17_CONSTEXPR duration</span>
<span id="L610"><span class="lineNum">     610</span>              :         operator++(int)</span>
<span id="L611"><span class="lineNum">     611</span>              :         { return duration(__r++); }</span>
<span id="L612"><span class="lineNum">     612</span>              : </span>
<span id="L613"><span class="lineNum">     613</span>              :         _GLIBCXX17_CONSTEXPR duration&amp;</span>
<span id="L614"><span class="lineNum">     614</span>              :         operator--()</span>
<span id="L615"><span class="lineNum">     615</span>              :         {</span>
<span id="L616"><span class="lineNum">     616</span>              :           --__r;</span>
<span id="L617"><span class="lineNum">     617</span>              :           return *this;</span>
<span id="L618"><span class="lineNum">     618</span>              :         }</span>
<span id="L619"><span class="lineNum">     619</span>              : </span>
<span id="L620"><span class="lineNum">     620</span>              :         _GLIBCXX17_CONSTEXPR duration</span>
<span id="L621"><span class="lineNum">     621</span>              :         operator--(int)</span>
<span id="L622"><span class="lineNum">     622</span>              :         { return duration(__r--); }</span>
<span id="L623"><span class="lineNum">     623</span>              : </span>
<span id="L624"><span class="lineNum">     624</span>              :         _GLIBCXX17_CONSTEXPR duration&amp;</span>
<span id="L625"><span class="lineNum">     625</span>              :         operator+=(const duration&amp; __d)</span>
<span id="L626"><span class="lineNum">     626</span>              :         {</span>
<span id="L627"><span class="lineNum">     627</span>              :           __r += __d.count();</span>
<span id="L628"><span class="lineNum">     628</span>              :           return *this;</span>
<span id="L629"><span class="lineNum">     629</span>              :         }</span>
<span id="L630"><span class="lineNum">     630</span>              : </span>
<span id="L631"><span class="lineNum">     631</span>              :         _GLIBCXX17_CONSTEXPR duration&amp;</span>
<span id="L632"><span class="lineNum">     632</span>              :         operator-=(const duration&amp; __d)</span>
<span id="L633"><span class="lineNum">     633</span>              :         {</span>
<span id="L634"><span class="lineNum">     634</span>              :           __r -= __d.count();</span>
<span id="L635"><span class="lineNum">     635</span>              :           return *this;</span>
<span id="L636"><span class="lineNum">     636</span>              :         }</span>
<span id="L637"><span class="lineNum">     637</span>              : </span>
<span id="L638"><span class="lineNum">     638</span>              :         _GLIBCXX17_CONSTEXPR duration&amp;</span>
<span id="L639"><span class="lineNum">     639</span>              :         operator*=(const rep&amp; __rhs)</span>
<span id="L640"><span class="lineNum">     640</span>              :         {</span>
<span id="L641"><span class="lineNum">     641</span>              :           __r *= __rhs;</span>
<span id="L642"><span class="lineNum">     642</span>              :           return *this;</span>
<span id="L643"><span class="lineNum">     643</span>              :         }</span>
<span id="L644"><span class="lineNum">     644</span>              : </span>
<span id="L645"><span class="lineNum">     645</span>              :         _GLIBCXX17_CONSTEXPR duration&amp;</span>
<span id="L646"><span class="lineNum">     646</span>              :         operator/=(const rep&amp; __rhs)</span>
<span id="L647"><span class="lineNum">     647</span>              :         {</span>
<span id="L648"><span class="lineNum">     648</span>              :           __r /= __rhs;</span>
<span id="L649"><span class="lineNum">     649</span>              :           return *this;</span>
<span id="L650"><span class="lineNum">     650</span>              :         }</span>
<span id="L651"><span class="lineNum">     651</span>              : </span>
<span id="L652"><span class="lineNum">     652</span>              :         // DR 934.</span>
<span id="L653"><span class="lineNum">     653</span>              :         template&lt;typename _Rep2 = rep&gt;</span>
<span id="L654"><span class="lineNum">     654</span>              :           _GLIBCXX17_CONSTEXPR</span>
<span id="L655"><span class="lineNum">     655</span>              :           __enable_if_t&lt;!treat_as_floating_point&lt;_Rep2&gt;::value, duration&amp;&gt;</span>
<span id="L656"><span class="lineNum">     656</span>              :           operator%=(const rep&amp; __rhs)</span>
<span id="L657"><span class="lineNum">     657</span>              :           {</span>
<span id="L658"><span class="lineNum">     658</span>              :             __r %= __rhs;</span>
<span id="L659"><span class="lineNum">     659</span>              :             return *this;</span>
<span id="L660"><span class="lineNum">     660</span>              :           }</span>
<span id="L661"><span class="lineNum">     661</span>              : </span>
<span id="L662"><span class="lineNum">     662</span>              :         template&lt;typename _Rep2 = rep&gt;</span>
<span id="L663"><span class="lineNum">     663</span>              :           _GLIBCXX17_CONSTEXPR</span>
<span id="L664"><span class="lineNum">     664</span>              :           __enable_if_t&lt;!treat_as_floating_point&lt;_Rep2&gt;::value, duration&amp;&gt;</span>
<span id="L665"><span class="lineNum">     665</span>              :           operator%=(const duration&amp; __d)</span>
<span id="L666"><span class="lineNum">     666</span>              :           {</span>
<span id="L667"><span class="lineNum">     667</span>              :             __r %= __d.count();</span>
<span id="L668"><span class="lineNum">     668</span>              :             return *this;</span>
<span id="L669"><span class="lineNum">     669</span>              :           }</span>
<span id="L670"><span class="lineNum">     670</span>              : </span>
<span id="L671"><span class="lineNum">     671</span>              :         // 20.11.5.4 special values</span>
<span id="L672"><span class="lineNum">     672</span>              :         static constexpr duration</span>
<span id="L673"><span class="lineNum">     673</span>              :         zero() noexcept</span>
<span id="L674"><span class="lineNum">     674</span>              :         { return duration(duration_values&lt;rep&gt;::zero()); }</span>
<span id="L675"><span class="lineNum">     675</span>              : </span>
<span id="L676"><span class="lineNum">     676</span>              :         static constexpr duration</span>
<span id="L677"><span class="lineNum">     677</span>              :         min() noexcept</span>
<span id="L678"><span class="lineNum">     678</span>              :         { return duration(duration_values&lt;rep&gt;::min()); }</span>
<span id="L679"><span class="lineNum">     679</span>              : </span>
<span id="L680"><span class="lineNum">     680</span>              :         static constexpr duration</span>
<span id="L681"><span class="lineNum">     681</span>              :         max() noexcept</span>
<span id="L682"><span class="lineNum">     682</span>              :         { return duration(duration_values&lt;rep&gt;::max()); }</span>
<span id="L683"><span class="lineNum">     683</span>              : </span>
<span id="L684"><span class="lineNum">     684</span>              :       private:</span>
<span id="L685"><span class="lineNum">     685</span>              :         rep __r;</span>
<span id="L686"><span class="lineNum">     686</span>              :       };</span>
<span id="L687"><span class="lineNum">     687</span>              : </span>
<span id="L688"><span class="lineNum">     688</span>              :     /// @{</span>
<span id="L689"><span class="lineNum">     689</span>              :     /// @relates std::chrono::duration</span>
<span id="L690"><span class="lineNum">     690</span>              : </span>
<span id="L691"><span class="lineNum">     691</span>              :     /// The sum of two durations.</span>
<span id="L692"><span class="lineNum">     692</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L693"><span class="lineNum">     693</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L694"><span class="lineNum">     694</span>              :       constexpr typename common_type&lt;duration&lt;_Rep1, _Period1&gt;,</span>
<span id="L695"><span class="lineNum">     695</span>              :                                      duration&lt;_Rep2, _Period2&gt;&gt;::type</span>
<span id="L696"><span class="lineNum">     696</span>              :       operator+(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L697"><span class="lineNum">     697</span>              :                 const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L698"><span class="lineNum">     698</span>              :       {</span>
<span id="L699"><span class="lineNum">     699</span>              :         typedef duration&lt;_Rep1, _Period1&gt;                 __dur1;</span>
<span id="L700"><span class="lineNum">     700</span>              :         typedef duration&lt;_Rep2, _Period2&gt;                 __dur2;</span>
<span id="L701"><span class="lineNum">     701</span>              :         typedef typename common_type&lt;__dur1,__dur2&gt;::type __cd;</span>
<span id="L702"><span class="lineNum">     702</span>              :         return __cd(__cd(__lhs).count() + __cd(__rhs).count());</span>
<span id="L703"><span class="lineNum">     703</span>              :       }</span>
<span id="L704"><span class="lineNum">     704</span>              : </span>
<span id="L705"><span class="lineNum">     705</span>              :     /// The difference between two durations.</span>
<span id="L706"><span class="lineNum">     706</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L707"><span class="lineNum">     707</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L708"><span class="lineNum">     708</span>              :       constexpr typename common_type&lt;duration&lt;_Rep1, _Period1&gt;,</span>
<span id="L709"><span class="lineNum">     709</span>              :                                      duration&lt;_Rep2, _Period2&gt;&gt;::type</span>
<span id="L710"><span class="lineNum">     710</span>              :       operator-(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L711"><span class="lineNum">     711</span>              :                 const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L712"><span class="lineNum">     712</span>              :       {</span>
<span id="L713"><span class="lineNum">     713</span>              :         typedef duration&lt;_Rep1, _Period1&gt;                 __dur1;</span>
<span id="L714"><span class="lineNum">     714</span>              :         typedef duration&lt;_Rep2, _Period2&gt;                 __dur2;</span>
<span id="L715"><span class="lineNum">     715</span>              :         typedef typename common_type&lt;__dur1,__dur2&gt;::type __cd;</span>
<span id="L716"><span class="lineNum">     716</span>              :         return __cd(__cd(__lhs).count() - __cd(__rhs).count());</span>
<span id="L717"><span class="lineNum">     717</span>              :       }</span>
<span id="L718"><span class="lineNum">     718</span>              : </span>
<span id="L719"><span class="lineNum">     719</span>              :     /// @}</span>
<span id="L720"><span class="lineNum">     720</span>              : </span>
<span id="L721"><span class="lineNum">     721</span>              :     /// @cond undocumented</span>
<span id="L722"><span class="lineNum">     722</span>              : </span>
<span id="L723"><span class="lineNum">     723</span>              :     // SFINAE helper to obtain common_type&lt;_Rep1, _Rep2&gt; only if _Rep2</span>
<span id="L724"><span class="lineNum">     724</span>              :     // is implicitly convertible to it.</span>
<span id="L725"><span class="lineNum">     725</span>              :     // _GLIBCXX_RESOLVE_LIB_DEFECTS</span>
<span id="L726"><span class="lineNum">     726</span>              :     // 3050. Conversion specification problem in chrono::duration constructor</span>
<span id="L727"><span class="lineNum">     727</span>              :     template&lt;typename _Rep1, typename _Rep2,</span>
<span id="L728"><span class="lineNum">     728</span>              :              typename _CRep = typename common_type&lt;_Rep1, _Rep2&gt;::type&gt;</span>
<span id="L729"><span class="lineNum">     729</span>              :       using __common_rep_t = typename</span>
<span id="L730"><span class="lineNum">     730</span>              :         enable_if&lt;is_convertible&lt;const _Rep2&amp;, _CRep&gt;::value, _CRep&gt;::type;</span>
<span id="L731"><span class="lineNum">     731</span>              : </span>
<span id="L732"><span class="lineNum">     732</span>              :     /// @endcond</span>
<span id="L733"><span class="lineNum">     733</span>              : </span>
<span id="L734"><span class="lineNum">     734</span>              :     /** @{</span>
<span id="L735"><span class="lineNum">     735</span>              :      * Arithmetic operators for chrono::duration</span>
<span id="L736"><span class="lineNum">     736</span>              :      * @relates std::chrono::duration</span>
<span id="L737"><span class="lineNum">     737</span>              :      */</span>
<span id="L738"><span class="lineNum">     738</span>              : </span>
<span id="L739"><span class="lineNum">     739</span>              :     template&lt;typename _Rep1, typename _Period, typename _Rep2&gt;</span>
<span id="L740"><span class="lineNum">     740</span>              :       constexpr duration&lt;__common_rep_t&lt;_Rep1, _Rep2&gt;, _Period&gt;</span>
<span id="L741"><span class="lineNum">     741</span>              :       operator*(const duration&lt;_Rep1, _Period&gt;&amp; __d, const _Rep2&amp; __s)</span>
<span id="L742"><span class="lineNum">     742</span>              :       {</span>
<span id="L743"><span class="lineNum">     743</span>              :         typedef duration&lt;typename common_type&lt;_Rep1, _Rep2&gt;::type, _Period&gt;</span>
<span id="L744"><span class="lineNum">     744</span>              :           __cd;</span>
<span id="L745"><span class="lineNum">     745</span>              :         return __cd(__cd(__d).count() * __s);</span>
<span id="L746"><span class="lineNum">     746</span>              :       }</span>
<span id="L747"><span class="lineNum">     747</span>              : </span>
<span id="L748"><span class="lineNum">     748</span>              :     template&lt;typename _Rep1, typename _Rep2, typename _Period&gt;</span>
<span id="L749"><span class="lineNum">     749</span>              :       constexpr duration&lt;__common_rep_t&lt;_Rep2, _Rep1&gt;, _Period&gt;</span>
<span id="L750"><span class="lineNum">     750</span>              :       operator*(const _Rep1&amp; __s, const duration&lt;_Rep2, _Period&gt;&amp; __d)</span>
<span id="L751"><span class="lineNum">     751</span>              :       { return __d * __s; }</span>
<span id="L752"><span class="lineNum">     752</span>              : </span>
<span id="L753"><span class="lineNum">     753</span>              :     template&lt;typename _Rep1, typename _Period, typename _Rep2&gt;</span>
<span id="L754"><span class="lineNum">     754</span>              :       constexpr</span>
<span id="L755"><span class="lineNum">     755</span>              :       duration&lt;__common_rep_t&lt;_Rep1, __disable_if_is_duration&lt;_Rep2&gt;&gt;, _Period&gt;</span>
<span id="L756"><span class="lineNum">     756</span>              :       operator/(const duration&lt;_Rep1, _Period&gt;&amp; __d, const _Rep2&amp; __s)</span>
<span id="L757"><span class="lineNum">     757</span>              :       {</span>
<span id="L758"><span class="lineNum">     758</span>              :         typedef duration&lt;typename common_type&lt;_Rep1, _Rep2&gt;::type, _Period&gt;</span>
<span id="L759"><span class="lineNum">     759</span>              :           __cd;</span>
<span id="L760"><span class="lineNum">     760</span>              :         return __cd(__cd(__d).count() / __s);</span>
<span id="L761"><span class="lineNum">     761</span>              :       }</span>
<span id="L762"><span class="lineNum">     762</span>              : </span>
<span id="L763"><span class="lineNum">     763</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L764"><span class="lineNum">     764</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L765"><span class="lineNum">     765</span>              :       constexpr typename common_type&lt;_Rep1, _Rep2&gt;::type</span>
<span id="L766"><span class="lineNum">     766</span>              :       operator/(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L767"><span class="lineNum">     767</span>              :                 const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L768"><span class="lineNum">     768</span>              :       {</span>
<span id="L769"><span class="lineNum">     769</span>              :         typedef duration&lt;_Rep1, _Period1&gt;                 __dur1;</span>
<span id="L770"><span class="lineNum">     770</span>              :         typedef duration&lt;_Rep2, _Period2&gt;                 __dur2;</span>
<span id="L771"><span class="lineNum">     771</span>              :         typedef typename common_type&lt;__dur1,__dur2&gt;::type __cd;</span>
<span id="L772"><span class="lineNum">     772</span>              :         return __cd(__lhs).count() / __cd(__rhs).count();</span>
<span id="L773"><span class="lineNum">     773</span>              :       }</span>
<span id="L774"><span class="lineNum">     774</span>              : </span>
<span id="L775"><span class="lineNum">     775</span>              :     // DR 934.</span>
<span id="L776"><span class="lineNum">     776</span>              :     template&lt;typename _Rep1, typename _Period, typename _Rep2&gt;</span>
<span id="L777"><span class="lineNum">     777</span>              :       constexpr</span>
<span id="L778"><span class="lineNum">     778</span>              :       duration&lt;__common_rep_t&lt;_Rep1, __disable_if_is_duration&lt;_Rep2&gt;&gt;, _Period&gt;</span>
<span id="L779"><span class="lineNum">     779</span>              :       operator%(const duration&lt;_Rep1, _Period&gt;&amp; __d, const _Rep2&amp; __s)</span>
<span id="L780"><span class="lineNum">     780</span>              :       {</span>
<span id="L781"><span class="lineNum">     781</span>              :         typedef duration&lt;typename common_type&lt;_Rep1, _Rep2&gt;::type, _Period&gt;</span>
<span id="L782"><span class="lineNum">     782</span>              :           __cd;</span>
<span id="L783"><span class="lineNum">     783</span>              :         return __cd(__cd(__d).count() % __s);</span>
<span id="L784"><span class="lineNum">     784</span>              :       }</span>
<span id="L785"><span class="lineNum">     785</span>              : </span>
<span id="L786"><span class="lineNum">     786</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L787"><span class="lineNum">     787</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L788"><span class="lineNum">     788</span>              :       constexpr typename common_type&lt;duration&lt;_Rep1, _Period1&gt;,</span>
<span id="L789"><span class="lineNum">     789</span>              :                                      duration&lt;_Rep2, _Period2&gt;&gt;::type</span>
<span id="L790"><span class="lineNum">     790</span>              :       operator%(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L791"><span class="lineNum">     791</span>              :                 const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L792"><span class="lineNum">     792</span>              :       {</span>
<span id="L793"><span class="lineNum">     793</span>              :         typedef duration&lt;_Rep1, _Period1&gt;                 __dur1;</span>
<span id="L794"><span class="lineNum">     794</span>              :         typedef duration&lt;_Rep2, _Period2&gt;                 __dur2;</span>
<span id="L795"><span class="lineNum">     795</span>              :         typedef typename common_type&lt;__dur1,__dur2&gt;::type __cd;</span>
<span id="L796"><span class="lineNum">     796</span>              :         return __cd(__cd(__lhs).count() % __cd(__rhs).count());</span>
<span id="L797"><span class="lineNum">     797</span>              :       }</span>
<span id="L798"><span class="lineNum">     798</span>              :     /// @}</span>
<span id="L799"><span class="lineNum">     799</span>              : </span>
<span id="L800"><span class="lineNum">     800</span>              :     // comparisons</span>
<span id="L801"><span class="lineNum">     801</span>              : </span>
<span id="L802"><span class="lineNum">     802</span>              :     /** @{</span>
<span id="L803"><span class="lineNum">     803</span>              :      * Comparisons for chrono::duration</span>
<span id="L804"><span class="lineNum">     804</span>              :      * @relates std::chrono::duration</span>
<span id="L805"><span class="lineNum">     805</span>              :      */</span>
<span id="L806"><span class="lineNum">     806</span>              : </span>
<span id="L807"><span class="lineNum">     807</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L808"><span class="lineNum">     808</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L809"><span class="lineNum">     809</span>              :       constexpr bool</span>
<span id="L810"><span class="lineNum">     810</span>              :       operator==(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L811"><span class="lineNum">     811</span>              :                  const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L812"><span class="lineNum">     812</span>              :       {</span>
<span id="L813"><span class="lineNum">     813</span>              :         typedef duration&lt;_Rep1, _Period1&gt;                 __dur1;</span>
<span id="L814"><span class="lineNum">     814</span>              :         typedef duration&lt;_Rep2, _Period2&gt;                 __dur2;</span>
<span id="L815"><span class="lineNum">     815</span>              :         typedef typename common_type&lt;__dur1,__dur2&gt;::type __ct;</span>
<span id="L816"><span class="lineNum">     816</span>              :         return __ct(__lhs).count() == __ct(__rhs).count();</span>
<span id="L817"><span class="lineNum">     817</span>              :       }</span>
<span id="L818"><span class="lineNum">     818</span>              : </span>
<span id="L819"><span class="lineNum">     819</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L820"><span class="lineNum">     820</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L821"><span class="lineNum">     821</span>              :       constexpr bool</span>
<span id="L822"><span class="lineNum">     822</span>              :       operator&lt;(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L823"><span class="lineNum">     823</span>              :                 const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L824"><span class="lineNum">     824</span>              :       {</span>
<span id="L825"><span class="lineNum">     825</span>              :         typedef duration&lt;_Rep1, _Period1&gt;                 __dur1;</span>
<span id="L826"><span class="lineNum">     826</span>              :         typedef duration&lt;_Rep2, _Period2&gt;                 __dur2;</span>
<span id="L827"><span class="lineNum">     827</span>              :         typedef typename common_type&lt;__dur1,__dur2&gt;::type __ct;</span>
<span id="L828"><span class="lineNum">     828</span>              :         return __ct(__lhs).count() &lt; __ct(__rhs).count();</span>
<span id="L829"><span class="lineNum">     829</span>              :       }</span>
<span id="L830"><span class="lineNum">     830</span>              : </span>
<span id="L831"><span class="lineNum">     831</span>              : #if __cpp_lib_three_way_comparison</span>
<span id="L832"><span class="lineNum">     832</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L833"><span class="lineNum">     833</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L834"><span class="lineNum">     834</span>              :       requires three_way_comparable&lt;common_type_t&lt;_Rep1, _Rep2&gt;&gt;</span>
<span id="L835"><span class="lineNum">     835</span>              :       constexpr auto</span>
<span id="L836"><span class="lineNum">     836</span>              :       operator&lt;=&gt;(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L837"><span class="lineNum">     837</span>              :                   const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L838"><span class="lineNum">     838</span>              :       {</span>
<span id="L839"><span class="lineNum">     839</span>              :         using __ct = common_type_t&lt;duration&lt;_Rep1, _Period1&gt;,</span>
<span id="L840"><span class="lineNum">     840</span>              :                                    duration&lt;_Rep2, _Period2&gt;&gt;;</span>
<span id="L841"><span class="lineNum">     841</span>              :         return __ct(__lhs).count() &lt;=&gt; __ct(__rhs).count();</span>
<span id="L842"><span class="lineNum">     842</span>              :       }</span>
<span id="L843"><span class="lineNum">     843</span>              : #else</span>
<span id="L844"><span class="lineNum">     844</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L845"><span class="lineNum">     845</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L846"><span class="lineNum">     846</span>              :       constexpr bool</span>
<span id="L847"><span class="lineNum">     847</span>              :       operator!=(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L848"><span class="lineNum">     848</span>              :                  const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L849"><span class="lineNum">     849</span>              :       { return !(__lhs == __rhs); }</span>
<span id="L850"><span class="lineNum">     850</span>              : #endif</span>
<span id="L851"><span class="lineNum">     851</span>              : </span>
<span id="L852"><span class="lineNum">     852</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L853"><span class="lineNum">     853</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L854"><span class="lineNum">     854</span>              :       constexpr bool</span>
<span id="L855"><span class="lineNum">     855</span>              :       operator&lt;=(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L856"><span class="lineNum">     856</span>              :                  const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L857"><span class="lineNum">     857</span>              :       { return !(__rhs &lt; __lhs); }</span>
<span id="L858"><span class="lineNum">     858</span>              : </span>
<span id="L859"><span class="lineNum">     859</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L860"><span class="lineNum">     860</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L861"><span class="lineNum">     861</span>              :       constexpr bool</span>
<span id="L862"><span class="lineNum">     862</span>              :       operator&gt;(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L863"><span class="lineNum">     863</span>              :                 const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L864"><span class="lineNum">     864</span>              :       { return __rhs &lt; __lhs; }</span>
<span id="L865"><span class="lineNum">     865</span>              : </span>
<span id="L866"><span class="lineNum">     866</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L867"><span class="lineNum">     867</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L868"><span class="lineNum">     868</span>              :       constexpr bool</span>
<span id="L869"><span class="lineNum">     869</span>              :       operator&gt;=(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L870"><span class="lineNum">     870</span>              :                  const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L871"><span class="lineNum">     871</span>              :       { return !(__lhs &lt; __rhs); }</span>
<span id="L872"><span class="lineNum">     872</span>              : </span>
<span id="L873"><span class="lineNum">     873</span>              :     /// @}</span>
<span id="L874"><span class="lineNum">     874</span>              : </span>
<span id="L875"><span class="lineNum">     875</span>              :     /// @cond undocumented</span>
<span id="L876"><span class="lineNum">     876</span>              : #ifdef _GLIBCXX_USE_C99_STDINT_TR1</span>
<span id="L877"><span class="lineNum">     877</span>              : # define _GLIBCXX_CHRONO_INT64_T int64_t</span>
<span id="L878"><span class="lineNum">     878</span>              : #elif defined __INT64_TYPE__</span>
<span id="L879"><span class="lineNum">     879</span>              : # define _GLIBCXX_CHRONO_INT64_T __INT64_TYPE__</span>
<span id="L880"><span class="lineNum">     880</span>              : #else</span>
<span id="L881"><span class="lineNum">     881</span>              :     static_assert(std::numeric_limits&lt;unsigned long long&gt;::digits &gt;= 64,</span>
<span id="L882"><span class="lineNum">     882</span>              :         &quot;Representation type for nanoseconds must have at least 64 bits&quot;);</span>
<span id="L883"><span class="lineNum">     883</span>              : # define _GLIBCXX_CHRONO_INT64_T long long</span>
<span id="L884"><span class="lineNum">     884</span>              : #endif</span>
<span id="L885"><span class="lineNum">     885</span>              :     /// @endcond</span>
<span id="L886"><span class="lineNum">     886</span>              : </span>
<span id="L887"><span class="lineNum">     887</span>              :     /// nanoseconds</span>
<span id="L888"><span class="lineNum">     888</span>              :     using nanoseconds   = duration&lt;_GLIBCXX_CHRONO_INT64_T, nano&gt;;</span>
<span id="L889"><span class="lineNum">     889</span>              : </span>
<span id="L890"><span class="lineNum">     890</span>              :     /// microseconds</span>
<span id="L891"><span class="lineNum">     891</span>              :     using microseconds  = duration&lt;_GLIBCXX_CHRONO_INT64_T, micro&gt;;</span>
<span id="L892"><span class="lineNum">     892</span>              : </span>
<span id="L893"><span class="lineNum">     893</span>              :     /// milliseconds</span>
<span id="L894"><span class="lineNum">     894</span>              :     using milliseconds  = duration&lt;_GLIBCXX_CHRONO_INT64_T, milli&gt;;</span>
<span id="L895"><span class="lineNum">     895</span>              : </span>
<span id="L896"><span class="lineNum">     896</span>              :     /// seconds</span>
<span id="L897"><span class="lineNum">     897</span>              :     using seconds       = duration&lt;_GLIBCXX_CHRONO_INT64_T&gt;;</span>
<span id="L898"><span class="lineNum">     898</span>              : </span>
<span id="L899"><span class="lineNum">     899</span>              :     /// minutes</span>
<span id="L900"><span class="lineNum">     900</span>              :     using minutes       = duration&lt;_GLIBCXX_CHRONO_INT64_T, ratio&lt; 60&gt;&gt;;</span>
<span id="L901"><span class="lineNum">     901</span>              : </span>
<span id="L902"><span class="lineNum">     902</span>              :     /// hours</span>
<span id="L903"><span class="lineNum">     903</span>              :     using hours         = duration&lt;_GLIBCXX_CHRONO_INT64_T, ratio&lt;3600&gt;&gt;;</span>
<span id="L904"><span class="lineNum">     904</span>              : </span>
<span id="L905"><span class="lineNum">     905</span>              : #if __cplusplus &gt; 201703L</span>
<span id="L906"><span class="lineNum">     906</span>              :     /// days</span>
<span id="L907"><span class="lineNum">     907</span>              :     using days          = duration&lt;_GLIBCXX_CHRONO_INT64_T, ratio&lt;86400&gt;&gt;;</span>
<span id="L908"><span class="lineNum">     908</span>              : </span>
<span id="L909"><span class="lineNum">     909</span>              :     /// weeks</span>
<span id="L910"><span class="lineNum">     910</span>              :     using weeks         = duration&lt;_GLIBCXX_CHRONO_INT64_T, ratio&lt;604800&gt;&gt;;</span>
<span id="L911"><span class="lineNum">     911</span>              : </span>
<span id="L912"><span class="lineNum">     912</span>              :     /// years</span>
<span id="L913"><span class="lineNum">     913</span>              :     using years         = duration&lt;_GLIBCXX_CHRONO_INT64_T, ratio&lt;31556952&gt;&gt;;</span>
<span id="L914"><span class="lineNum">     914</span>              : </span>
<span id="L915"><span class="lineNum">     915</span>              :     /// months</span>
<span id="L916"><span class="lineNum">     916</span>              :     using months        = duration&lt;_GLIBCXX_CHRONO_INT64_T, ratio&lt;2629746&gt;&gt;;</span>
<span id="L917"><span class="lineNum">     917</span>              : #endif // C++20</span>
<span id="L918"><span class="lineNum">     918</span>              : </span>
<span id="L919"><span class="lineNum">     919</span>              : #undef _GLIBCXX_CHRONO_INT64_T</span>
<span id="L920"><span class="lineNum">     920</span>              : </span>
<span id="L921"><span class="lineNum">     921</span>              :     template&lt;typename _Clock, typename _Dur&gt;</span>
<span id="L922"><span class="lineNum">     922</span>              :       class time_point</span>
<span id="L923"><span class="lineNum">     923</span>              :       {</span>
<span id="L924"><span class="lineNum">     924</span>              :         static_assert(__is_duration&lt;_Dur&gt;::value,</span>
<span id="L925"><span class="lineNum">     925</span>              :             &quot;duration must be a specialization of std::chrono::duration&quot;);</span>
<span id="L926"><span class="lineNum">     926</span>              : </span>
<span id="L927"><span class="lineNum">     927</span>              :       public:</span>
<span id="L928"><span class="lineNum">     928</span>              :         typedef _Clock                                          clock;</span>
<span id="L929"><span class="lineNum">     929</span>              :         typedef _Dur                                            duration;</span>
<span id="L930"><span class="lineNum">     930</span>              :         typedef typename duration::rep                          rep;</span>
<span id="L931"><span class="lineNum">     931</span>              :         typedef typename duration::period                       period;</span>
<span id="L932"><span class="lineNum">     932</span>              : </span>
<span id="L933"><span class="lineNum">     933</span>              :         constexpr time_point() : __d(duration::zero())</span>
<span id="L934"><span class="lineNum">     934</span>              :         { }</span>
<span id="L935"><span class="lineNum">     935</span>              : </span>
<span id="L936"><span class="lineNum">     936</span>              :         constexpr explicit time_point(const duration&amp; __dur)</span>
<span id="L937"><span class="lineNum">     937</span>              :         : __d(__dur)</span>
<span id="L938"><span class="lineNum">     938</span>              :         { }</span>
<span id="L939"><span class="lineNum">     939</span>              : </span>
<span id="L940"><span class="lineNum">     940</span>              :         // conversions</span>
<span id="L941"><span class="lineNum">     941</span>              :         template&lt;typename _Dur2,</span>
<span id="L942"><span class="lineNum">     942</span>              :                  typename = _Require&lt;is_convertible&lt;_Dur2, _Dur&gt;&gt;&gt;</span>
<span id="L943"><span class="lineNum">     943</span>              :           constexpr time_point(const time_point&lt;clock, _Dur2&gt;&amp; __t)</span>
<span id="L944"><span class="lineNum">     944</span>              :           : __d(__t.time_since_epoch())</span>
<span id="L945"><span class="lineNum">     945</span>              :           { }</span>
<span id="L946"><span class="lineNum">     946</span>              : </span>
<span id="L947"><span class="lineNum">     947</span>              :         // observer</span>
<span id="L948"><span class="lineNum">     948</span>              :         constexpr duration</span>
<span id="L949"><span class="lineNum">     949</span> <span class="tlaGNC">           2 :         time_since_epoch() const</span></span>
<span id="L950"><span class="lineNum">     950</span> <span class="tlaGNC">           2 :         { return __d; }</span></span>
<span id="L951"><span class="lineNum">     951</span>              : </span>
<span id="L952"><span class="lineNum">     952</span>              : #if __cplusplus &gt; 201703L</span>
<span id="L953"><span class="lineNum">     953</span>              :         constexpr time_point&amp;</span>
<span id="L954"><span class="lineNum">     954</span>              :         operator++()</span>
<span id="L955"><span class="lineNum">     955</span>              :         {</span>
<span id="L956"><span class="lineNum">     956</span>              :           ++__d;</span>
<span id="L957"><span class="lineNum">     957</span>              :           return *this;</span>
<span id="L958"><span class="lineNum">     958</span>              :         }</span>
<span id="L959"><span class="lineNum">     959</span>              : </span>
<span id="L960"><span class="lineNum">     960</span>              :         constexpr time_point</span>
<span id="L961"><span class="lineNum">     961</span>              :         operator++(int)</span>
<span id="L962"><span class="lineNum">     962</span>              :         { return time_point{__d++}; }</span>
<span id="L963"><span class="lineNum">     963</span>              : </span>
<span id="L964"><span class="lineNum">     964</span>              :         constexpr time_point&amp;</span>
<span id="L965"><span class="lineNum">     965</span>              :         operator--()</span>
<span id="L966"><span class="lineNum">     966</span>              :         {</span>
<span id="L967"><span class="lineNum">     967</span>              :           --__d;</span>
<span id="L968"><span class="lineNum">     968</span>              :           return *this;</span>
<span id="L969"><span class="lineNum">     969</span>              :         }</span>
<span id="L970"><span class="lineNum">     970</span>              : </span>
<span id="L971"><span class="lineNum">     971</span>              :         constexpr time_point</span>
<span id="L972"><span class="lineNum">     972</span>              :         operator--(int)</span>
<span id="L973"><span class="lineNum">     973</span>              :         { return time_point{__d--}; }</span>
<span id="L974"><span class="lineNum">     974</span>              : #endif</span>
<span id="L975"><span class="lineNum">     975</span>              : </span>
<span id="L976"><span class="lineNum">     976</span>              :         // arithmetic</span>
<span id="L977"><span class="lineNum">     977</span>              :         _GLIBCXX17_CONSTEXPR time_point&amp;</span>
<span id="L978"><span class="lineNum">     978</span>              :         operator+=(const duration&amp; __dur)</span>
<span id="L979"><span class="lineNum">     979</span>              :         {</span>
<span id="L980"><span class="lineNum">     980</span>              :           __d += __dur;</span>
<span id="L981"><span class="lineNum">     981</span>              :           return *this;</span>
<span id="L982"><span class="lineNum">     982</span>              :         }</span>
<span id="L983"><span class="lineNum">     983</span>              : </span>
<span id="L984"><span class="lineNum">     984</span>              :         _GLIBCXX17_CONSTEXPR time_point&amp;</span>
<span id="L985"><span class="lineNum">     985</span>              :         operator-=(const duration&amp; __dur)</span>
<span id="L986"><span class="lineNum">     986</span>              :         {</span>
<span id="L987"><span class="lineNum">     987</span>              :           __d -= __dur;</span>
<span id="L988"><span class="lineNum">     988</span>              :           return *this;</span>
<span id="L989"><span class="lineNum">     989</span>              :         }</span>
<span id="L990"><span class="lineNum">     990</span>              : </span>
<span id="L991"><span class="lineNum">     991</span>              :         // special values</span>
<span id="L992"><span class="lineNum">     992</span>              :         static constexpr time_point</span>
<span id="L993"><span class="lineNum">     993</span>              :         min() noexcept</span>
<span id="L994"><span class="lineNum">     994</span>              :         { return time_point(duration::min()); }</span>
<span id="L995"><span class="lineNum">     995</span>              : </span>
<span id="L996"><span class="lineNum">     996</span>              :         static constexpr time_point</span>
<span id="L997"><span class="lineNum">     997</span>              :         max() noexcept</span>
<span id="L998"><span class="lineNum">     998</span>              :         { return time_point(duration::max()); }</span>
<span id="L999"><span class="lineNum">     999</span>              : </span>
<span id="L1000"><span class="lineNum">    1000</span>              :       private:</span>
<span id="L1001"><span class="lineNum">    1001</span>              :         duration __d;</span>
<span id="L1002"><span class="lineNum">    1002</span>              :       };</span>
<span id="L1003"><span class="lineNum">    1003</span>              : </span>
<span id="L1004"><span class="lineNum">    1004</span>              :     /** Convert a `time_point` to use `duration` type `ToDur`.</span>
<span id="L1005"><span class="lineNum">    1005</span>              :      *</span>
<span id="L1006"><span class="lineNum">    1006</span>              :      * The result is the same time point as measured by the same clock, but</span>
<span id="L1007"><span class="lineNum">    1007</span>              :      * using the specified `duration` to represent the time.</span>
<span id="L1008"><span class="lineNum">    1008</span>              :      * If the time point cannot be represented accurately in the result type,</span>
<span id="L1009"><span class="lineNum">    1009</span>              :      * returns the result of integer truncation (i.e., rounded towards zero).</span>
<span id="L1010"><span class="lineNum">    1010</span>              :      *</span>
<span id="L1011"><span class="lineNum">    1011</span>              :      * @tparam _ToDur The `duration` type to use for the result.</span>
<span id="L1012"><span class="lineNum">    1012</span>              :      * @param __t A time point.</span>
<span id="L1013"><span class="lineNum">    1013</span>              :      * @return The value of `__t` converted to use type `_ToDur`.</span>
<span id="L1014"><span class="lineNum">    1014</span>              :      * @since C++11</span>
<span id="L1015"><span class="lineNum">    1015</span>              :      */</span>
<span id="L1016"><span class="lineNum">    1016</span>              :     template&lt;typename _ToDur, typename _Clock, typename _Dur&gt;</span>
<span id="L1017"><span class="lineNum">    1017</span>              :       _GLIBCXX_NODISCARD constexpr</span>
<span id="L1018"><span class="lineNum">    1018</span>              :       __enable_if_t&lt;__is_duration&lt;_ToDur&gt;::value, time_point&lt;_Clock, _ToDur&gt;&gt;</span>
<span id="L1019"><span class="lineNum">    1019</span>              :       time_point_cast(const time_point&lt;_Clock, _Dur&gt;&amp; __t)</span>
<span id="L1020"><span class="lineNum">    1020</span>              :       {</span>
<span id="L1021"><span class="lineNum">    1021</span>              :         typedef time_point&lt;_Clock, _ToDur&gt;                        __time_point;</span>
<span id="L1022"><span class="lineNum">    1022</span>              :         return __time_point(duration_cast&lt;_ToDur&gt;(__t.time_since_epoch()));</span>
<span id="L1023"><span class="lineNum">    1023</span>              :       }</span>
<span id="L1024"><span class="lineNum">    1024</span>              : </span>
<span id="L1025"><span class="lineNum">    1025</span>              : #if __cplusplus &gt; 201402L</span>
<span id="L1026"><span class="lineNum">    1026</span>              :     /** Convert a `time_point` to type `ToDur` and round down.</span>
<span id="L1027"><span class="lineNum">    1027</span>              :      *</span>
<span id="L1028"><span class="lineNum">    1028</span>              :      * The result is the same time point as measured by the same clock, but</span>
<span id="L1029"><span class="lineNum">    1029</span>              :      * using the specified `duration` to represent the time.</span>
<span id="L1030"><span class="lineNum">    1030</span>              :      * If the time point cannot be represented exactly in the result type,</span>
<span id="L1031"><span class="lineNum">    1031</span>              :      * returns the closest value that is less than the argument.</span>
<span id="L1032"><span class="lineNum">    1032</span>              :      *</span>
<span id="L1033"><span class="lineNum">    1033</span>              :      * @tparam _ToDur The `duration` type to use for the result.</span>
<span id="L1034"><span class="lineNum">    1034</span>              :      * @param __t A time point.</span>
<span id="L1035"><span class="lineNum">    1035</span>              :      * @return The value of `__d` converted to type `_ToDur`.</span>
<span id="L1036"><span class="lineNum">    1036</span>              :      * @since C++17</span>
<span id="L1037"><span class="lineNum">    1037</span>              :      */</span>
<span id="L1038"><span class="lineNum">    1038</span>              :     template&lt;typename _ToDur, typename _Clock, typename _Dur&gt;</span>
<span id="L1039"><span class="lineNum">    1039</span>              :       [[nodiscard]] constexpr</span>
<span id="L1040"><span class="lineNum">    1040</span>              :       enable_if_t&lt;__is_duration_v&lt;_ToDur&gt;, time_point&lt;_Clock, _ToDur&gt;&gt;</span>
<span id="L1041"><span class="lineNum">    1041</span>              :       floor(const time_point&lt;_Clock, _Dur&gt;&amp; __tp)</span>
<span id="L1042"><span class="lineNum">    1042</span>              :       {</span>
<span id="L1043"><span class="lineNum">    1043</span>              :         return time_point&lt;_Clock, _ToDur&gt;{</span>
<span id="L1044"><span class="lineNum">    1044</span>              :             chrono::floor&lt;_ToDur&gt;(__tp.time_since_epoch())};</span>
<span id="L1045"><span class="lineNum">    1045</span>              :       }</span>
<span id="L1046"><span class="lineNum">    1046</span>              : </span>
<span id="L1047"><span class="lineNum">    1047</span>              :     /** Convert a `time_point` to type `ToDur` and round up.</span>
<span id="L1048"><span class="lineNum">    1048</span>              :      *</span>
<span id="L1049"><span class="lineNum">    1049</span>              :      * The result is the same time point as measured by the same clock, but</span>
<span id="L1050"><span class="lineNum">    1050</span>              :      * using the specified `duration` to represent the time.</span>
<span id="L1051"><span class="lineNum">    1051</span>              :      * If the time point cannot be represented exactly in the result type,</span>
<span id="L1052"><span class="lineNum">    1052</span>              :      * returns the closest value that is greater than the argument.</span>
<span id="L1053"><span class="lineNum">    1053</span>              :      *</span>
<span id="L1054"><span class="lineNum">    1054</span>              :      * @tparam _ToDur The `duration` type to use for the result.</span>
<span id="L1055"><span class="lineNum">    1055</span>              :      * @param __t A time point.</span>
<span id="L1056"><span class="lineNum">    1056</span>              :      * @return The value of `__d` converted to type `_ToDur`.</span>
<span id="L1057"><span class="lineNum">    1057</span>              :      * @since C++17</span>
<span id="L1058"><span class="lineNum">    1058</span>              :      */</span>
<span id="L1059"><span class="lineNum">    1059</span>              :     template&lt;typename _ToDur, typename _Clock, typename _Dur&gt;</span>
<span id="L1060"><span class="lineNum">    1060</span>              :       [[nodiscard]] constexpr</span>
<span id="L1061"><span class="lineNum">    1061</span>              :       enable_if_t&lt;__is_duration_v&lt;_ToDur&gt;, time_point&lt;_Clock, _ToDur&gt;&gt;</span>
<span id="L1062"><span class="lineNum">    1062</span>              :       ceil(const time_point&lt;_Clock, _Dur&gt;&amp; __tp)</span>
<span id="L1063"><span class="lineNum">    1063</span>              :       {</span>
<span id="L1064"><span class="lineNum">    1064</span>              :         return time_point&lt;_Clock, _ToDur&gt;{</span>
<span id="L1065"><span class="lineNum">    1065</span>              :             chrono::ceil&lt;_ToDur&gt;(__tp.time_since_epoch())};</span>
<span id="L1066"><span class="lineNum">    1066</span>              :       }</span>
<span id="L1067"><span class="lineNum">    1067</span>              : </span>
<span id="L1068"><span class="lineNum">    1068</span>              :     /** Convert a `time_point` to type `ToDur` and round to the closest value.</span>
<span id="L1069"><span class="lineNum">    1069</span>              :      *</span>
<span id="L1070"><span class="lineNum">    1070</span>              :      * The result is the same time point as measured by the same clock, but</span>
<span id="L1071"><span class="lineNum">    1071</span>              :      * using the specified `duration` to represent the time.</span>
<span id="L1072"><span class="lineNum">    1072</span>              :      * If the time point cannot be represented exactly in the result type,</span>
<span id="L1073"><span class="lineNum">    1073</span>              :      * returns the closest value, rounding ties to even.</span>
<span id="L1074"><span class="lineNum">    1074</span>              :      *</span>
<span id="L1075"><span class="lineNum">    1075</span>              :      * @tparam _ToDur The `duration` type to use for the result,</span>
<span id="L1076"><span class="lineNum">    1076</span>              :      *                which must have a non-floating-point `rep` type.</span>
<span id="L1077"><span class="lineNum">    1077</span>              :      * @param __t A time point.</span>
<span id="L1078"><span class="lineNum">    1078</span>              :      * @return The value of `__d` converted to type `_ToDur`.</span>
<span id="L1079"><span class="lineNum">    1079</span>              :      * @since C++17</span>
<span id="L1080"><span class="lineNum">    1080</span>              :      */</span>
<span id="L1081"><span class="lineNum">    1081</span>              :     template&lt;typename _ToDur, typename _Clock, typename _Dur&gt;</span>
<span id="L1082"><span class="lineNum">    1082</span>              :       [[nodiscard]] constexpr</span>
<span id="L1083"><span class="lineNum">    1083</span>              :       enable_if_t&lt;__is_duration_v&lt;_ToDur&gt;</span>
<span id="L1084"><span class="lineNum">    1084</span>              :                     &amp;&amp; !treat_as_floating_point_v&lt;typename _ToDur::rep&gt;,</span>
<span id="L1085"><span class="lineNum">    1085</span>              :                   time_point&lt;_Clock, _ToDur&gt;&gt;</span>
<span id="L1086"><span class="lineNum">    1086</span>              :       round(const time_point&lt;_Clock, _Dur&gt;&amp; __tp)</span>
<span id="L1087"><span class="lineNum">    1087</span>              :       {</span>
<span id="L1088"><span class="lineNum">    1088</span>              :         return time_point&lt;_Clock, _ToDur&gt;{</span>
<span id="L1089"><span class="lineNum">    1089</span>              :             chrono::round&lt;_ToDur&gt;(__tp.time_since_epoch())};</span>
<span id="L1090"><span class="lineNum">    1090</span>              :       }</span>
<span id="L1091"><span class="lineNum">    1091</span>              : #endif // C++17</span>
<span id="L1092"><span class="lineNum">    1092</span>              : </span>
<span id="L1093"><span class="lineNum">    1093</span>              :     /// @{</span>
<span id="L1094"><span class="lineNum">    1094</span>              :     /// @relates time_point</span>
<span id="L1095"><span class="lineNum">    1095</span>              : </span>
<span id="L1096"><span class="lineNum">    1096</span>              :     /// Adjust a time point forwards by the given duration.</span>
<span id="L1097"><span class="lineNum">    1097</span>              :     template&lt;typename _Clock, typename _Dur1,</span>
<span id="L1098"><span class="lineNum">    1098</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L1099"><span class="lineNum">    1099</span>              :       constexpr time_point&lt;_Clock,</span>
<span id="L1100"><span class="lineNum">    1100</span>              :         typename common_type&lt;_Dur1, duration&lt;_Rep2, _Period2&gt;&gt;::type&gt;</span>
<span id="L1101"><span class="lineNum">    1101</span>              :       operator+(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1102"><span class="lineNum">    1102</span>              :                 const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L1103"><span class="lineNum">    1103</span>              :       {</span>
<span id="L1104"><span class="lineNum">    1104</span>              :         typedef duration&lt;_Rep2, _Period2&gt;                 __dur2;</span>
<span id="L1105"><span class="lineNum">    1105</span>              :         typedef typename common_type&lt;_Dur1,__dur2&gt;::type  __ct;</span>
<span id="L1106"><span class="lineNum">    1106</span>              :         typedef time_point&lt;_Clock, __ct&gt;                  __time_point;</span>
<span id="L1107"><span class="lineNum">    1107</span>              :         return __time_point(__lhs.time_since_epoch() + __rhs);</span>
<span id="L1108"><span class="lineNum">    1108</span>              :       }</span>
<span id="L1109"><span class="lineNum">    1109</span>              : </span>
<span id="L1110"><span class="lineNum">    1110</span>              :     /// Adjust a time point forwards by the given duration.</span>
<span id="L1111"><span class="lineNum">    1111</span>              :     template&lt;typename _Rep1, typename _Period1,</span>
<span id="L1112"><span class="lineNum">    1112</span>              :              typename _Clock, typename _Dur2&gt;</span>
<span id="L1113"><span class="lineNum">    1113</span>              :       constexpr time_point&lt;_Clock,</span>
<span id="L1114"><span class="lineNum">    1114</span>              :         typename common_type&lt;duration&lt;_Rep1, _Period1&gt;, _Dur2&gt;::type&gt;</span>
<span id="L1115"><span class="lineNum">    1115</span>              :       operator+(const duration&lt;_Rep1, _Period1&gt;&amp; __lhs,</span>
<span id="L1116"><span class="lineNum">    1116</span>              :                 const time_point&lt;_Clock, _Dur2&gt;&amp; __rhs)</span>
<span id="L1117"><span class="lineNum">    1117</span>              :       {</span>
<span id="L1118"><span class="lineNum">    1118</span>              :         typedef duration&lt;_Rep1, _Period1&gt;                 __dur1;</span>
<span id="L1119"><span class="lineNum">    1119</span>              :         typedef typename common_type&lt;__dur1,_Dur2&gt;::type  __ct;</span>
<span id="L1120"><span class="lineNum">    1120</span>              :         typedef time_point&lt;_Clock, __ct&gt;                  __time_point;</span>
<span id="L1121"><span class="lineNum">    1121</span>              :         return __time_point(__rhs.time_since_epoch() + __lhs);</span>
<span id="L1122"><span class="lineNum">    1122</span>              :       }</span>
<span id="L1123"><span class="lineNum">    1123</span>              : </span>
<span id="L1124"><span class="lineNum">    1124</span>              :     /// Adjust a time point backwards by the given duration.</span>
<span id="L1125"><span class="lineNum">    1125</span>              :     template&lt;typename _Clock, typename _Dur1,</span>
<span id="L1126"><span class="lineNum">    1126</span>              :              typename _Rep2, typename _Period2&gt;</span>
<span id="L1127"><span class="lineNum">    1127</span>              :       constexpr time_point&lt;_Clock,</span>
<span id="L1128"><span class="lineNum">    1128</span>              :         typename common_type&lt;_Dur1, duration&lt;_Rep2, _Period2&gt;&gt;::type&gt;</span>
<span id="L1129"><span class="lineNum">    1129</span>              :       operator-(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1130"><span class="lineNum">    1130</span>              :                 const duration&lt;_Rep2, _Period2&gt;&amp; __rhs)</span>
<span id="L1131"><span class="lineNum">    1131</span>              :       {</span>
<span id="L1132"><span class="lineNum">    1132</span>              :         typedef duration&lt;_Rep2, _Period2&gt;                 __dur2;</span>
<span id="L1133"><span class="lineNum">    1133</span>              :         typedef typename common_type&lt;_Dur1,__dur2&gt;::type  __ct;</span>
<span id="L1134"><span class="lineNum">    1134</span>              :         typedef time_point&lt;_Clock, __ct&gt;                  __time_point;</span>
<span id="L1135"><span class="lineNum">    1135</span>              :         return __time_point(__lhs.time_since_epoch() -__rhs);</span>
<span id="L1136"><span class="lineNum">    1136</span>              :       }</span>
<span id="L1137"><span class="lineNum">    1137</span>              : </span>
<span id="L1138"><span class="lineNum">    1138</span>              :     /// The difference between two time points (as a duration)</span>
<span id="L1139"><span class="lineNum">    1139</span>              :     template&lt;typename _Clock, typename _Dur1, typename _Dur2&gt;</span>
<span id="L1140"><span class="lineNum">    1140</span>              :       constexpr typename common_type&lt;_Dur1, _Dur2&gt;::type</span>
<span id="L1141"><span class="lineNum">    1141</span>              :       operator-(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1142"><span class="lineNum">    1142</span>              :                 const time_point&lt;_Clock, _Dur2&gt;&amp; __rhs)</span>
<span id="L1143"><span class="lineNum">    1143</span>              :       { return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }</span>
<span id="L1144"><span class="lineNum">    1144</span>              :     /// @}</span>
<span id="L1145"><span class="lineNum">    1145</span>              : </span>
<span id="L1146"><span class="lineNum">    1146</span>              :     /** @{</span>
<span id="L1147"><span class="lineNum">    1147</span>              :      * Comparisons for time_point</span>
<span id="L1148"><span class="lineNum">    1148</span>              :      * @relates chrono::time_point</span>
<span id="L1149"><span class="lineNum">    1149</span>              :      */</span>
<span id="L1150"><span class="lineNum">    1150</span>              : </span>
<span id="L1151"><span class="lineNum">    1151</span>              :     template&lt;typename _Clock, typename _Dur1, typename _Dur2&gt;</span>
<span id="L1152"><span class="lineNum">    1152</span>              :       constexpr bool</span>
<span id="L1153"><span class="lineNum">    1153</span>              :       operator==(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1154"><span class="lineNum">    1154</span>              :                  const time_point&lt;_Clock, _Dur2&gt;&amp; __rhs)</span>
<span id="L1155"><span class="lineNum">    1155</span>              :       { return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }</span>
<span id="L1156"><span class="lineNum">    1156</span>              : </span>
<span id="L1157"><span class="lineNum">    1157</span>              : #if __cpp_lib_three_way_comparison</span>
<span id="L1158"><span class="lineNum">    1158</span>              :     template&lt;typename _Clock, typename _Dur1,</span>
<span id="L1159"><span class="lineNum">    1159</span>              :              three_way_comparable_with&lt;_Dur1&gt; _Dur2&gt;</span>
<span id="L1160"><span class="lineNum">    1160</span>              :       constexpr auto</span>
<span id="L1161"><span class="lineNum">    1161</span>              :       operator&lt;=&gt;(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1162"><span class="lineNum">    1162</span>              :                   const time_point&lt;_Clock, _Dur2&gt;&amp; __rhs)</span>
<span id="L1163"><span class="lineNum">    1163</span>              :       { return __lhs.time_since_epoch() &lt;=&gt; __rhs.time_since_epoch(); }</span>
<span id="L1164"><span class="lineNum">    1164</span>              : #else</span>
<span id="L1165"><span class="lineNum">    1165</span>              :     template&lt;typename _Clock, typename _Dur1, typename _Dur2&gt;</span>
<span id="L1166"><span class="lineNum">    1166</span>              :       constexpr bool</span>
<span id="L1167"><span class="lineNum">    1167</span>              :       operator!=(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1168"><span class="lineNum">    1168</span>              :                  const time_point&lt;_Clock, _Dur2&gt;&amp; __rhs)</span>
<span id="L1169"><span class="lineNum">    1169</span>              :       { return !(__lhs == __rhs); }</span>
<span id="L1170"><span class="lineNum">    1170</span>              : #endif</span>
<span id="L1171"><span class="lineNum">    1171</span>              : </span>
<span id="L1172"><span class="lineNum">    1172</span>              :     template&lt;typename _Clock, typename _Dur1, typename _Dur2&gt;</span>
<span id="L1173"><span class="lineNum">    1173</span>              :       constexpr bool</span>
<span id="L1174"><span class="lineNum">    1174</span>              :       operator&lt;(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1175"><span class="lineNum">    1175</span>              :                 const time_point&lt;_Clock, _Dur2&gt;&amp; __rhs)</span>
<span id="L1176"><span class="lineNum">    1176</span>              :       { return  __lhs.time_since_epoch() &lt; __rhs.time_since_epoch(); }</span>
<span id="L1177"><span class="lineNum">    1177</span>              : </span>
<span id="L1178"><span class="lineNum">    1178</span>              :     template&lt;typename _Clock, typename _Dur1, typename _Dur2&gt;</span>
<span id="L1179"><span class="lineNum">    1179</span>              :       constexpr bool</span>
<span id="L1180"><span class="lineNum">    1180</span>              :       operator&lt;=(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1181"><span class="lineNum">    1181</span>              :                  const time_point&lt;_Clock, _Dur2&gt;&amp; __rhs)</span>
<span id="L1182"><span class="lineNum">    1182</span>              :       { return !(__rhs &lt; __lhs); }</span>
<span id="L1183"><span class="lineNum">    1183</span>              : </span>
<span id="L1184"><span class="lineNum">    1184</span>              :     template&lt;typename _Clock, typename _Dur1, typename _Dur2&gt;</span>
<span id="L1185"><span class="lineNum">    1185</span>              :       constexpr bool</span>
<span id="L1186"><span class="lineNum">    1186</span>              :       operator&gt;(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1187"><span class="lineNum">    1187</span>              :                 const time_point&lt;_Clock, _Dur2&gt;&amp; __rhs)</span>
<span id="L1188"><span class="lineNum">    1188</span>              :       { return __rhs &lt; __lhs; }</span>
<span id="L1189"><span class="lineNum">    1189</span>              : </span>
<span id="L1190"><span class="lineNum">    1190</span>              :     template&lt;typename _Clock, typename _Dur1, typename _Dur2&gt;</span>
<span id="L1191"><span class="lineNum">    1191</span>              :       constexpr bool</span>
<span id="L1192"><span class="lineNum">    1192</span>              :       operator&gt;=(const time_point&lt;_Clock, _Dur1&gt;&amp; __lhs,</span>
<span id="L1193"><span class="lineNum">    1193</span>              :                  const time_point&lt;_Clock, _Dur2&gt;&amp; __rhs)</span>
<span id="L1194"><span class="lineNum">    1194</span>              :       { return !(__lhs &lt; __rhs); }</span>
<span id="L1195"><span class="lineNum">    1195</span>              : </span>
<span id="L1196"><span class="lineNum">    1196</span>              :     /// @}</span>
<span id="L1197"><span class="lineNum">    1197</span>              :     /// @} group chrono</span>
<span id="L1198"><span class="lineNum">    1198</span>              : </span>
<span id="L1199"><span class="lineNum">    1199</span>              :     // Clocks.</span>
<span id="L1200"><span class="lineNum">    1200</span>              : </span>
<span id="L1201"><span class="lineNum">    1201</span>              :     // Why nanosecond resolution as the default?</span>
<span id="L1202"><span class="lineNum">    1202</span>              :     // Why have std::system_clock always count in the highest</span>
<span id="L1203"><span class="lineNum">    1203</span>              :     // resolution (ie nanoseconds), even if on some OSes the low 3</span>
<span id="L1204"><span class="lineNum">    1204</span>              :     // or 9 decimal digits will be always zero? This allows later</span>
<span id="L1205"><span class="lineNum">    1205</span>              :     // implementations to change the system_clock::now()</span>
<span id="L1206"><span class="lineNum">    1206</span>              :     // implementation any time to provide better resolution without</span>
<span id="L1207"><span class="lineNum">    1207</span>              :     // changing function signature or units.</span>
<span id="L1208"><span class="lineNum">    1208</span>              : </span>
<span id="L1209"><span class="lineNum">    1209</span>              :     // To support the (forward) evolution of the library's defined</span>
<span id="L1210"><span class="lineNum">    1210</span>              :     // clocks, wrap inside inline namespace so that the current</span>
<span id="L1211"><span class="lineNum">    1211</span>              :     // defintions of system_clock, steady_clock, and</span>
<span id="L1212"><span class="lineNum">    1212</span>              :     // high_resolution_clock types are uniquely mangled. This way, new</span>
<span id="L1213"><span class="lineNum">    1213</span>              :     // code can use the latests clocks, while the library can contain</span>
<span id="L1214"><span class="lineNum">    1214</span>              :     // compatibility definitions for previous versions.  At some</span>
<span id="L1215"><span class="lineNum">    1215</span>              :     // point, when these clocks settle down, the inlined namespaces</span>
<span id="L1216"><span class="lineNum">    1216</span>              :     // can be removed.  XXX GLIBCXX_ABI Deprecated</span>
<span id="L1217"><span class="lineNum">    1217</span>              : _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)</span>
<span id="L1218"><span class="lineNum">    1218</span>              : </span>
<span id="L1219"><span class="lineNum">    1219</span>              :     /**</span>
<span id="L1220"><span class="lineNum">    1220</span>              :      *  @brief System clock.</span>
<span id="L1221"><span class="lineNum">    1221</span>              :      *</span>
<span id="L1222"><span class="lineNum">    1222</span>              :      *  Time returned represents wall time from the system-wide clock.</span>
<span id="L1223"><span class="lineNum">    1223</span>              :      *  @ingroup chrono</span>
<span id="L1224"><span class="lineNum">    1224</span>              :     */</span>
<span id="L1225"><span class="lineNum">    1225</span>              :     struct system_clock</span>
<span id="L1226"><span class="lineNum">    1226</span>              :     {</span>
<span id="L1227"><span class="lineNum">    1227</span>              :       typedef chrono::nanoseconds                               duration;</span>
<span id="L1228"><span class="lineNum">    1228</span>              :       typedef duration::rep                                     rep;</span>
<span id="L1229"><span class="lineNum">    1229</span>              :       typedef duration::period                                  period;</span>
<span id="L1230"><span class="lineNum">    1230</span>              :       typedef chrono::time_point&lt;system_clock, duration&gt;  time_point;</span>
<span id="L1231"><span class="lineNum">    1231</span>              : </span>
<span id="L1232"><span class="lineNum">    1232</span>              :       static_assert(system_clock::duration::min()</span>
<span id="L1233"><span class="lineNum">    1233</span>              :                     &lt; system_clock::duration::zero(),</span>
<span id="L1234"><span class="lineNum">    1234</span>              :                     &quot;a clock's minimum duration cannot be less than its epoch&quot;);</span>
<span id="L1235"><span class="lineNum">    1235</span>              : </span>
<span id="L1236"><span class="lineNum">    1236</span>              :       static constexpr bool is_steady = false;</span>
<span id="L1237"><span class="lineNum">    1237</span>              : </span>
<span id="L1238"><span class="lineNum">    1238</span>              :       static time_point</span>
<span id="L1239"><span class="lineNum">    1239</span>              :       now() noexcept;</span>
<span id="L1240"><span class="lineNum">    1240</span>              : </span>
<span id="L1241"><span class="lineNum">    1241</span>              :       // Map to C API</span>
<span id="L1242"><span class="lineNum">    1242</span>              :       _GLIBCXX_TIME_BITS64_ABI_TAG</span>
<span id="L1243"><span class="lineNum">    1243</span>              :       static std::time_t</span>
<span id="L1244"><span class="lineNum">    1244</span> <span class="tlaGNC">           2 :       to_time_t(const time_point&amp; __t) noexcept</span></span>
<span id="L1245"><span class="lineNum">    1245</span>              :       {</span>
<span id="L1246"><span class="lineNum">    1246</span>              :         return std::time_t(duration_cast&lt;chrono::seconds&gt;</span>
<span id="L1247"><span class="lineNum">    1247</span> <span class="tlaGNC">           2 :                            (__t.time_since_epoch()).count());</span></span>
<span id="L1248"><span class="lineNum">    1248</span>              :       }</span>
<span id="L1249"><span class="lineNum">    1249</span>              : </span>
<span id="L1250"><span class="lineNum">    1250</span>              :       _GLIBCXX_TIME_BITS64_ABI_TAG</span>
<span id="L1251"><span class="lineNum">    1251</span>              :       static time_point</span>
<span id="L1252"><span class="lineNum">    1252</span>              :       from_time_t(std::time_t __t) noexcept</span>
<span id="L1253"><span class="lineNum">    1253</span>              :       {</span>
<span id="L1254"><span class="lineNum">    1254</span>              :         typedef chrono::time_point&lt;system_clock, seconds&gt; __from;</span>
<span id="L1255"><span class="lineNum">    1255</span>              :         return time_point_cast&lt;system_clock::duration&gt;</span>
<span id="L1256"><span class="lineNum">    1256</span>              :                (__from(chrono::seconds(__t)));</span>
<span id="L1257"><span class="lineNum">    1257</span>              :       }</span>
<span id="L1258"><span class="lineNum">    1258</span>              :     };</span>
<span id="L1259"><span class="lineNum">    1259</span>              : </span>
<span id="L1260"><span class="lineNum">    1260</span>              : </span>
<span id="L1261"><span class="lineNum">    1261</span>              :     /**</span>
<span id="L1262"><span class="lineNum">    1262</span>              :      *  @brief Monotonic clock</span>
<span id="L1263"><span class="lineNum">    1263</span>              :      *</span>
<span id="L1264"><span class="lineNum">    1264</span>              :      *  Time returned has the property of only increasing at a uniform rate.</span>
<span id="L1265"><span class="lineNum">    1265</span>              :      *  @ingroup chrono</span>
<span id="L1266"><span class="lineNum">    1266</span>              :     */</span>
<span id="L1267"><span class="lineNum">    1267</span>              :     struct steady_clock</span>
<span id="L1268"><span class="lineNum">    1268</span>              :     {</span>
<span id="L1269"><span class="lineNum">    1269</span>              :       typedef chrono::nanoseconds                               duration;</span>
<span id="L1270"><span class="lineNum">    1270</span>              :       typedef duration::rep                                     rep;</span>
<span id="L1271"><span class="lineNum">    1271</span>              :       typedef duration::period                                  period;</span>
<span id="L1272"><span class="lineNum">    1272</span>              :       typedef chrono::time_point&lt;steady_clock, duration&gt;  time_point;</span>
<span id="L1273"><span class="lineNum">    1273</span>              : </span>
<span id="L1274"><span class="lineNum">    1274</span>              :       static constexpr bool is_steady = true;</span>
<span id="L1275"><span class="lineNum">    1275</span>              : </span>
<span id="L1276"><span class="lineNum">    1276</span>              :       static time_point</span>
<span id="L1277"><span class="lineNum">    1277</span>              :       now() noexcept;</span>
<span id="L1278"><span class="lineNum">    1278</span>              :     };</span>
<span id="L1279"><span class="lineNum">    1279</span>              : </span>
<span id="L1280"><span class="lineNum">    1280</span>              : </span>
<span id="L1281"><span class="lineNum">    1281</span>              :     /**</span>
<span id="L1282"><span class="lineNum">    1282</span>              :      *  @brief Highest-resolution clock</span>
<span id="L1283"><span class="lineNum">    1283</span>              :      *</span>
<span id="L1284"><span class="lineNum">    1284</span>              :      *  This is the clock &quot;with the shortest tick period.&quot; Alias to</span>
<span id="L1285"><span class="lineNum">    1285</span>              :      *  std::system_clock until higher-than-nanosecond definitions</span>
<span id="L1286"><span class="lineNum">    1286</span>              :      *  become feasible.</span>
<span id="L1287"><span class="lineNum">    1287</span>              :      *  @ingroup chrono</span>
<span id="L1288"><span class="lineNum">    1288</span>              :     */</span>
<span id="L1289"><span class="lineNum">    1289</span>              :     using high_resolution_clock = system_clock;</span>
<span id="L1290"><span class="lineNum">    1290</span>              : </span>
<span id="L1291"><span class="lineNum">    1291</span>              : _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)</span>
<span id="L1292"><span class="lineNum">    1292</span>              : </span>
<span id="L1293"><span class="lineNum">    1293</span>              : #if __cplusplus &gt;= 202002L</span>
<span id="L1294"><span class="lineNum">    1294</span>              :     /// @addtogroup chrono</span>
<span id="L1295"><span class="lineNum">    1295</span>              :     /// @{</span>
<span id="L1296"><span class="lineNum">    1296</span>              :     template&lt;typename _Duration&gt;</span>
<span id="L1297"><span class="lineNum">    1297</span>              :       using sys_time = time_point&lt;system_clock, _Duration&gt;;</span>
<span id="L1298"><span class="lineNum">    1298</span>              :     using sys_seconds = sys_time&lt;seconds&gt;;</span>
<span id="L1299"><span class="lineNum">    1299</span>              :     using sys_days = sys_time&lt;days&gt;;</span>
<span id="L1300"><span class="lineNum">    1300</span>              : </span>
<span id="L1301"><span class="lineNum">    1301</span>              :     using file_clock = ::std::filesystem::__file_clock;</span>
<span id="L1302"><span class="lineNum">    1302</span>              : </span>
<span id="L1303"><span class="lineNum">    1303</span>              :     template&lt;typename _Duration&gt;</span>
<span id="L1304"><span class="lineNum">    1304</span>              :       using file_time = time_point&lt;file_clock, _Duration&gt;;</span>
<span id="L1305"><span class="lineNum">    1305</span>              : </span>
<span id="L1306"><span class="lineNum">    1306</span>              :     template&lt;&gt; struct is_clock&lt;system_clock&gt; : true_type { };</span>
<span id="L1307"><span class="lineNum">    1307</span>              :     template&lt;&gt; struct is_clock&lt;steady_clock&gt; : true_type { };</span>
<span id="L1308"><span class="lineNum">    1308</span>              :     template&lt;&gt; struct is_clock&lt;file_clock&gt; : true_type { };</span>
<span id="L1309"><span class="lineNum">    1309</span>              : </span>
<span id="L1310"><span class="lineNum">    1310</span>              :     template&lt;&gt; inline constexpr bool is_clock_v&lt;system_clock&gt; = true;</span>
<span id="L1311"><span class="lineNum">    1311</span>              :     template&lt;&gt; inline constexpr bool is_clock_v&lt;steady_clock&gt; = true;</span>
<span id="L1312"><span class="lineNum">    1312</span>              :     template&lt;&gt; inline constexpr bool is_clock_v&lt;file_clock&gt; = true;</span>
<span id="L1313"><span class="lineNum">    1313</span>              :     /// @}</span>
<span id="L1314"><span class="lineNum">    1314</span>              : #endif // C++20</span>
<span id="L1315"><span class="lineNum">    1315</span>              :   } // namespace chrono</span>
<span id="L1316"><span class="lineNum">    1316</span>              : </span>
<span id="L1317"><span class="lineNum">    1317</span>              : #if __cplusplus &gt;= 201402L</span>
<span id="L1318"><span class="lineNum">    1318</span>              : #define __cpp_lib_chrono_udls 201304L</span>
<span id="L1319"><span class="lineNum">    1319</span>              : </span>
<span id="L1320"><span class="lineNum">    1320</span>              :   inline namespace literals</span>
<span id="L1321"><span class="lineNum">    1321</span>              :   {</span>
<span id="L1322"><span class="lineNum">    1322</span>              :   /** ISO C++ 2014  namespace for suffixes for duration literals.</span>
<span id="L1323"><span class="lineNum">    1323</span>              :    *</span>
<span id="L1324"><span class="lineNum">    1324</span>              :    * These suffixes can be used to create `chrono::duration` values with</span>
<span id="L1325"><span class="lineNum">    1325</span>              :    * tick periods of hours, minutes, seconds, milliseconds, microseconds</span>
<span id="L1326"><span class="lineNum">    1326</span>              :    * or nanoseconds. For example, `std::chrono::seconds(5)` can be written</span>
<span id="L1327"><span class="lineNum">    1327</span>              :    * as `5s` after making the suffix visible in the current scope.</span>
<span id="L1328"><span class="lineNum">    1328</span>              :    * The suffixes can be made visible by a using-directive or</span>
<span id="L1329"><span class="lineNum">    1329</span>              :    * using-declaration such as:</span>
<span id="L1330"><span class="lineNum">    1330</span>              :    *  - `using namespace std::chrono_literals;`</span>
<span id="L1331"><span class="lineNum">    1331</span>              :    *  - `using namespace std::literals;`</span>
<span id="L1332"><span class="lineNum">    1332</span>              :    *  - `using namespace std::chrono;`</span>
<span id="L1333"><span class="lineNum">    1333</span>              :    *  - `using namespace std;`</span>
<span id="L1334"><span class="lineNum">    1334</span>              :    *  - `using std::chrono_literals::operator&quot;&quot;s;`</span>
<span id="L1335"><span class="lineNum">    1335</span>              :    *</span>
<span id="L1336"><span class="lineNum">    1336</span>              :    * The result of these suffixes on an integer literal is one of the</span>
<span id="L1337"><span class="lineNum">    1337</span>              :    * standard typedefs such as `std::chrono::hours`.</span>
<span id="L1338"><span class="lineNum">    1338</span>              :    * The result on a floating-point literal is a duration type with the</span>
<span id="L1339"><span class="lineNum">    1339</span>              :    * specified tick period and an unspecified floating-point representation,</span>
<span id="L1340"><span class="lineNum">    1340</span>              :    * for example `1.5e2ms` might be equivalent to</span>
<span id="L1341"><span class="lineNum">    1341</span>              :    * `chrono::duration&lt;long double, chrono::milli&gt;(1.5e2)`.</span>
<span id="L1342"><span class="lineNum">    1342</span>              :    *</span>
<span id="L1343"><span class="lineNum">    1343</span>              :    * @since C+14</span>
<span id="L1344"><span class="lineNum">    1344</span>              :    * @ingroup chrono</span>
<span id="L1345"><span class="lineNum">    1345</span>              :    */</span>
<span id="L1346"><span class="lineNum">    1346</span>              :   inline namespace chrono_literals</span>
<span id="L1347"><span class="lineNum">    1347</span>              :   {</span>
<span id="L1348"><span class="lineNum">    1348</span>              :     /// @addtogroup chrono</span>
<span id="L1349"><span class="lineNum">    1349</span>              :     /// @{</span>
<span id="L1350"><span class="lineNum">    1350</span>              : </span>
<span id="L1351"><span class="lineNum">    1351</span>              : #pragma GCC diagnostic push</span>
<span id="L1352"><span class="lineNum">    1352</span>              : #pragma GCC diagnostic ignored &quot;-Wliteral-suffix&quot;</span>
<span id="L1353"><span class="lineNum">    1353</span>              :     /// @cond undocumented</span>
<span id="L1354"><span class="lineNum">    1354</span>              :     template&lt;typename _Dur, char... _Digits&gt;</span>
<span id="L1355"><span class="lineNum">    1355</span>              :       constexpr _Dur __check_overflow()</span>
<span id="L1356"><span class="lineNum">    1356</span>              :       {</span>
<span id="L1357"><span class="lineNum">    1357</span>              :         using _Val = __parse_int::_Parse_int&lt;_Digits...&gt;;</span>
<span id="L1358"><span class="lineNum">    1358</span>              :         constexpr typename _Dur::rep __repval = _Val::value;</span>
<span id="L1359"><span class="lineNum">    1359</span>              :         static_assert(__repval &gt;= 0 &amp;&amp; __repval == _Val::value,</span>
<span id="L1360"><span class="lineNum">    1360</span>              :                       &quot;literal value cannot be represented by duration type&quot;);</span>
<span id="L1361"><span class="lineNum">    1361</span>              :         return _Dur(__repval);</span>
<span id="L1362"><span class="lineNum">    1362</span>              :       }</span>
<span id="L1363"><span class="lineNum">    1363</span>              :     /// @endcond</span>
<span id="L1364"><span class="lineNum">    1364</span>              : </span>
<span id="L1365"><span class="lineNum">    1365</span>              :     /// Literal suffix for durations representing non-integer hours</span>
<span id="L1366"><span class="lineNum">    1366</span>              :     constexpr chrono::duration&lt;long double, ratio&lt;3600,1&gt;&gt;</span>
<span id="L1367"><span class="lineNum">    1367</span>              :     operator&quot;&quot;h(long double __hours)</span>
<span id="L1368"><span class="lineNum">    1368</span>              :     { return chrono::duration&lt;long double, ratio&lt;3600,1&gt;&gt;{__hours}; }</span>
<span id="L1369"><span class="lineNum">    1369</span>              : </span>
<span id="L1370"><span class="lineNum">    1370</span>              :     /// Literal suffix for durations of type `std::chrono::hours`</span>
<span id="L1371"><span class="lineNum">    1371</span>              :     template &lt;char... _Digits&gt;</span>
<span id="L1372"><span class="lineNum">    1372</span>              :       constexpr chrono::hours</span>
<span id="L1373"><span class="lineNum">    1373</span>              :       operator&quot;&quot;h()</span>
<span id="L1374"><span class="lineNum">    1374</span>              :       { return __check_overflow&lt;chrono::hours, _Digits...&gt;(); }</span>
<span id="L1375"><span class="lineNum">    1375</span>              : </span>
<span id="L1376"><span class="lineNum">    1376</span>              :     /// Literal suffix for durations representing non-integer minutes</span>
<span id="L1377"><span class="lineNum">    1377</span>              :     constexpr chrono::duration&lt;long double, ratio&lt;60,1&gt;&gt;</span>
<span id="L1378"><span class="lineNum">    1378</span>              :     operator&quot;&quot;min(long double __mins)</span>
<span id="L1379"><span class="lineNum">    1379</span>              :     { return chrono::duration&lt;long double, ratio&lt;60,1&gt;&gt;{__mins}; }</span>
<span id="L1380"><span class="lineNum">    1380</span>              : </span>
<span id="L1381"><span class="lineNum">    1381</span>              :     /// Literal suffix for durations of type `std::chrono::minutes`</span>
<span id="L1382"><span class="lineNum">    1382</span>              :     template &lt;char... _Digits&gt;</span>
<span id="L1383"><span class="lineNum">    1383</span>              :       constexpr chrono::minutes</span>
<span id="L1384"><span class="lineNum">    1384</span>              :       operator&quot;&quot;min()</span>
<span id="L1385"><span class="lineNum">    1385</span>              :       { return __check_overflow&lt;chrono::minutes, _Digits...&gt;(); }</span>
<span id="L1386"><span class="lineNum">    1386</span>              : </span>
<span id="L1387"><span class="lineNum">    1387</span>              :     /// Literal suffix for durations representing non-integer seconds</span>
<span id="L1388"><span class="lineNum">    1388</span>              :     constexpr chrono::duration&lt;long double&gt;</span>
<span id="L1389"><span class="lineNum">    1389</span>              :     operator&quot;&quot;s(long double __secs)</span>
<span id="L1390"><span class="lineNum">    1390</span>              :     { return chrono::duration&lt;long double&gt;{__secs}; }</span>
<span id="L1391"><span class="lineNum">    1391</span>              : </span>
<span id="L1392"><span class="lineNum">    1392</span>              :     /// Literal suffix for durations of type `std::chrono::seconds`</span>
<span id="L1393"><span class="lineNum">    1393</span>              :     template &lt;char... _Digits&gt;</span>
<span id="L1394"><span class="lineNum">    1394</span>              :       constexpr chrono::seconds</span>
<span id="L1395"><span class="lineNum">    1395</span>              :       operator&quot;&quot;s()</span>
<span id="L1396"><span class="lineNum">    1396</span>              :       { return __check_overflow&lt;chrono::seconds, _Digits...&gt;(); }</span>
<span id="L1397"><span class="lineNum">    1397</span>              : </span>
<span id="L1398"><span class="lineNum">    1398</span>              :     /// Literal suffix for durations representing non-integer milliseconds</span>
<span id="L1399"><span class="lineNum">    1399</span>              :     constexpr chrono::duration&lt;long double, milli&gt;</span>
<span id="L1400"><span class="lineNum">    1400</span>              :     operator&quot;&quot;ms(long double __msecs)</span>
<span id="L1401"><span class="lineNum">    1401</span>              :     { return chrono::duration&lt;long double, milli&gt;{__msecs}; }</span>
<span id="L1402"><span class="lineNum">    1402</span>              : </span>
<span id="L1403"><span class="lineNum">    1403</span>              :     /// Literal suffix for durations of type `std::chrono::milliseconds`</span>
<span id="L1404"><span class="lineNum">    1404</span>              :     template &lt;char... _Digits&gt;</span>
<span id="L1405"><span class="lineNum">    1405</span>              :       constexpr chrono::milliseconds</span>
<span id="L1406"><span class="lineNum">    1406</span>              :       operator&quot;&quot;ms()</span>
<span id="L1407"><span class="lineNum">    1407</span>              :       { return __check_overflow&lt;chrono::milliseconds, _Digits...&gt;(); }</span>
<span id="L1408"><span class="lineNum">    1408</span>              : </span>
<span id="L1409"><span class="lineNum">    1409</span>              :     /// Literal suffix for durations representing non-integer microseconds</span>
<span id="L1410"><span class="lineNum">    1410</span>              :     constexpr chrono::duration&lt;long double, micro&gt;</span>
<span id="L1411"><span class="lineNum">    1411</span>              :     operator&quot;&quot;us(long double __usecs)</span>
<span id="L1412"><span class="lineNum">    1412</span>              :     { return chrono::duration&lt;long double, micro&gt;{__usecs}; }</span>
<span id="L1413"><span class="lineNum">    1413</span>              : </span>
<span id="L1414"><span class="lineNum">    1414</span>              :     /// Literal suffix for durations of type `std::chrono::microseconds`</span>
<span id="L1415"><span class="lineNum">    1415</span>              :     template &lt;char... _Digits&gt;</span>
<span id="L1416"><span class="lineNum">    1416</span>              :       constexpr chrono::microseconds</span>
<span id="L1417"><span class="lineNum">    1417</span>              :       operator&quot;&quot;us()</span>
<span id="L1418"><span class="lineNum">    1418</span>              :       { return __check_overflow&lt;chrono::microseconds, _Digits...&gt;(); }</span>
<span id="L1419"><span class="lineNum">    1419</span>              : </span>
<span id="L1420"><span class="lineNum">    1420</span>              :     /// Literal suffix for durations representing non-integer nanoseconds</span>
<span id="L1421"><span class="lineNum">    1421</span>              :     constexpr chrono::duration&lt;long double, nano&gt;</span>
<span id="L1422"><span class="lineNum">    1422</span>              :     operator&quot;&quot;ns(long double __nsecs)</span>
<span id="L1423"><span class="lineNum">    1423</span>              :     { return chrono::duration&lt;long double, nano&gt;{__nsecs}; }</span>
<span id="L1424"><span class="lineNum">    1424</span>              : </span>
<span id="L1425"><span class="lineNum">    1425</span>              :     /// Literal suffix for durations of type `std::chrono::nanoseconds`</span>
<span id="L1426"><span class="lineNum">    1426</span>              :     template &lt;char... _Digits&gt;</span>
<span id="L1427"><span class="lineNum">    1427</span>              :       constexpr chrono::nanoseconds</span>
<span id="L1428"><span class="lineNum">    1428</span>              :       operator&quot;&quot;ns()</span>
<span id="L1429"><span class="lineNum">    1429</span>              :       { return __check_overflow&lt;chrono::nanoseconds, _Digits...&gt;(); }</span>
<span id="L1430"><span class="lineNum">    1430</span>              : </span>
<span id="L1431"><span class="lineNum">    1431</span>              : #pragma GCC diagnostic pop</span>
<span id="L1432"><span class="lineNum">    1432</span>              :     /// @}</span>
<span id="L1433"><span class="lineNum">    1433</span>              :   } // inline namespace chrono_literals</span>
<span id="L1434"><span class="lineNum">    1434</span>              :   } // inline namespace literals</span>
<span id="L1435"><span class="lineNum">    1435</span>              : </span>
<span id="L1436"><span class="lineNum">    1436</span>              :   namespace chrono</span>
<span id="L1437"><span class="lineNum">    1437</span>              :   {</span>
<span id="L1438"><span class="lineNum">    1438</span>              :     using namespace literals::chrono_literals;</span>
<span id="L1439"><span class="lineNum">    1439</span>              :   } // namespace chrono</span>
<span id="L1440"><span class="lineNum">    1440</span>              : #endif // C++14</span>
<span id="L1441"><span class="lineNum">    1441</span>              : </span>
<span id="L1442"><span class="lineNum">    1442</span>              : #if __cplusplus &gt;= 201703L</span>
<span id="L1443"><span class="lineNum">    1443</span>              :   namespace filesystem</span>
<span id="L1444"><span class="lineNum">    1444</span>              :   {</span>
<span id="L1445"><span class="lineNum">    1445</span>              :     struct __file_clock</span>
<span id="L1446"><span class="lineNum">    1446</span>              :     {</span>
<span id="L1447"><span class="lineNum">    1447</span>              :       using duration                  = chrono::nanoseconds;</span>
<span id="L1448"><span class="lineNum">    1448</span>              :       using rep                       = duration::rep;</span>
<span id="L1449"><span class="lineNum">    1449</span>              :       using period                    = duration::period;</span>
<span id="L1450"><span class="lineNum">    1450</span>              :       using time_point                = chrono::time_point&lt;__file_clock&gt;;</span>
<span id="L1451"><span class="lineNum">    1451</span>              :       static constexpr bool is_steady = false;</span>
<span id="L1452"><span class="lineNum">    1452</span>              : </span>
<span id="L1453"><span class="lineNum">    1453</span>              :       static time_point</span>
<span id="L1454"><span class="lineNum">    1454</span>              :       now() noexcept</span>
<span id="L1455"><span class="lineNum">    1455</span>              :       { return _S_from_sys(chrono::system_clock::now()); }</span>
<span id="L1456"><span class="lineNum">    1456</span>              : </span>
<span id="L1457"><span class="lineNum">    1457</span>              : #if __cplusplus &gt; 201703L</span>
<span id="L1458"><span class="lineNum">    1458</span>              :       template&lt;typename _Dur&gt;</span>
<span id="L1459"><span class="lineNum">    1459</span>              :         static</span>
<span id="L1460"><span class="lineNum">    1460</span>              :         chrono::file_time&lt;common_type_t&lt;_Dur, chrono::seconds&gt;&gt;</span>
<span id="L1461"><span class="lineNum">    1461</span>              :         from_sys(const chrono::sys_time&lt;_Dur&gt;&amp; __t) noexcept</span>
<span id="L1462"><span class="lineNum">    1462</span>              :         { return _S_from_sys(__t); }</span>
<span id="L1463"><span class="lineNum">    1463</span>              : </span>
<span id="L1464"><span class="lineNum">    1464</span>              :       // For internal use only</span>
<span id="L1465"><span class="lineNum">    1465</span>              :       template&lt;typename _Dur&gt;</span>
<span id="L1466"><span class="lineNum">    1466</span>              :         static</span>
<span id="L1467"><span class="lineNum">    1467</span>              :         chrono::sys_time&lt;common_type_t&lt;_Dur, chrono::seconds&gt;&gt;</span>
<span id="L1468"><span class="lineNum">    1468</span>              :         to_sys(const chrono::file_time&lt;_Dur&gt;&amp; __t) noexcept</span>
<span id="L1469"><span class="lineNum">    1469</span>              :         { return _S_to_sys(__t); }</span>
<span id="L1470"><span class="lineNum">    1470</span>              : #endif // C++20</span>
<span id="L1471"><span class="lineNum">    1471</span>              : </span>
<span id="L1472"><span class="lineNum">    1472</span>              :     private:</span>
<span id="L1473"><span class="lineNum">    1473</span>              :       using __sys_clock = chrono::system_clock;</span>
<span id="L1474"><span class="lineNum">    1474</span>              : </span>
<span id="L1475"><span class="lineNum">    1475</span>              :       // This clock's (unspecified) epoch is 2174-01-01 00:00:00 UTC.</span>
<span id="L1476"><span class="lineNum">    1476</span>              :       // A signed 64-bit duration with nanosecond resolution gives roughly</span>
<span id="L1477"><span class="lineNum">    1477</span>              :       // +/- 292 years, which covers the 1901-2446 date range for ext4.</span>
<span id="L1478"><span class="lineNum">    1478</span>              :       static constexpr chrono::seconds _S_epoch_diff{6437664000};</span>
<span id="L1479"><span class="lineNum">    1479</span>              : </span>
<span id="L1480"><span class="lineNum">    1480</span>              :     protected:</span>
<span id="L1481"><span class="lineNum">    1481</span>              :       // For internal use only</span>
<span id="L1482"><span class="lineNum">    1482</span>              :       template&lt;typename _Dur&gt;</span>
<span id="L1483"><span class="lineNum">    1483</span>              :         static</span>
<span id="L1484"><span class="lineNum">    1484</span>              :         chrono::time_point&lt;__file_clock, common_type_t&lt;_Dur, chrono::seconds&gt;&gt;</span>
<span id="L1485"><span class="lineNum">    1485</span>              :         _S_from_sys(const chrono::time_point&lt;__sys_clock, _Dur&gt;&amp; __t) noexcept</span>
<span id="L1486"><span class="lineNum">    1486</span>              :         {</span>
<span id="L1487"><span class="lineNum">    1487</span>              :           using _CDur = common_type_t&lt;_Dur, chrono::seconds&gt;;</span>
<span id="L1488"><span class="lineNum">    1488</span>              :           using __file_time = chrono::time_point&lt;__file_clock, _CDur&gt;;</span>
<span id="L1489"><span class="lineNum">    1489</span>              :           return __file_time{__t.time_since_epoch()} - _S_epoch_diff;</span>
<span id="L1490"><span class="lineNum">    1490</span>              :         }</span>
<span id="L1491"><span class="lineNum">    1491</span>              : </span>
<span id="L1492"><span class="lineNum">    1492</span>              :       // For internal use only</span>
<span id="L1493"><span class="lineNum">    1493</span>              :       template&lt;typename _Dur&gt;</span>
<span id="L1494"><span class="lineNum">    1494</span>              :         static</span>
<span id="L1495"><span class="lineNum">    1495</span>              :         chrono::time_point&lt;__sys_clock, common_type_t&lt;_Dur, chrono::seconds&gt;&gt;</span>
<span id="L1496"><span class="lineNum">    1496</span>              :         _S_to_sys(const chrono::time_point&lt;__file_clock, _Dur&gt;&amp; __t) noexcept</span>
<span id="L1497"><span class="lineNum">    1497</span>              :         {</span>
<span id="L1498"><span class="lineNum">    1498</span>              :           using _CDur = common_type_t&lt;_Dur, chrono::seconds&gt;;</span>
<span id="L1499"><span class="lineNum">    1499</span>              :           using __sys_time = chrono::time_point&lt;__sys_clock, _CDur&gt;;</span>
<span id="L1500"><span class="lineNum">    1500</span>              :           return __sys_time{__t.time_since_epoch()} + _S_epoch_diff;</span>
<span id="L1501"><span class="lineNum">    1501</span>              :         }</span>
<span id="L1502"><span class="lineNum">    1502</span>              :     };</span>
<span id="L1503"><span class="lineNum">    1503</span>              :   } // namespace filesystem</span>
<span id="L1504"><span class="lineNum">    1504</span>              : #endif // C++17</span>
<span id="L1505"><span class="lineNum">    1505</span>              : </span>
<span id="L1506"><span class="lineNum">    1506</span>              : _GLIBCXX_END_NAMESPACE_VERSION</span>
<span id="L1507"><span class="lineNum">    1507</span>              : } // namespace std</span>
<span id="L1508"><span class="lineNum">    1508</span>              : </span>
<span id="L1509"><span class="lineNum">    1509</span>              : #endif // C++11</span>
<span id="L1510"><span class="lineNum">    1510</span>              : </span>
<span id="L1511"><span class="lineNum">    1511</span>              : #endif //_GLIBCXX_CHRONO_H</span>
        </pre>
              </td>
            </tr>
          </table>
          <br>

          <table width="100%" border=0 cellspacing=0 cellpadding=0>
            <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
            <tr><td class="versionInfo">Generated by: <a href="https://github.com//linux-test-project/lcov" target="_parent">LCOV version 2.0-1</a></td></tr>
          </table>
          <br>

</body>
</html>
